-
Notifications
You must be signed in to change notification settings - Fork 29
feat: escalations parity #482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
# Conflicts: # src/uipath_langchain/agent/tools/escalation_tool.py
1031401 to
d7b0d0a
Compare
| else: | ||
| raise NotImplementedError( | ||
| f"TaskTitle type '{type(channel.task_title).__name__}' not implemented" | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this throw when neither str nor tokens task_title is present? The previous code falls back to "Escalation Task" when task_title is none
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the before validator for task title in uipath-python, if "taskTitleV2" or "taskTitle" fields are missing, then I am defaulting to "Escaltion task" -> so task_title should always be either of type textbuilder or string.
| ) | ||
| tool.metadata["taskTitle"] = build_string_from_tokens( | ||
| channel.task_title.tokens, sanitize_dict_for_serialization(dict(state)) | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think here we should set the taskTitle metadata (str) in both cases (textBuilder and str). That way in extract_task_title we can just read the taskTitle string from the metadata, without instance checking.
Could also be a function if too large:
| ) | |
| if tool.metadata is None: | |
| raise ... | |
| tool.metadata["taskTitle"] = build_task_title(channel.task_title) |
|
|
||
| # Recipient requires runtime resolution, store in metadata after resolving | ||
| if tool.metadata is not None: | ||
| tool.metadata["recipient"] = recipient |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do task_title = tool.metadata["task_title"] in this if.
|
|
||
| result = interrupt( | ||
| CreateEscalation( | ||
| title=task_title, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and title=task_title or "Escalation Task" here
| raise RuntimeError( | ||
| "Tool metadata is required for TEXT_BUILDER task titles" | ||
| ) | ||
| tool.metadata["taskTitle"] = build_string_from_tokens( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other metadata keys are snake_case, let's use task_title for consistency
Resolve task_title for action center task