Repository navigation
nexus_operation_as_tool - #949
Conversation
4ddba85 to
9cde5d0
Compare
cretz
left a comment
There was a problem hiding this comment.
LGTM as is. Admittedly I have never reviewed the activity as tool code in depth either. Would like @tconley1428 to approve.
| } | ||
| operation_callable.__name__ = operation.name | ||
|
|
||
| schema = function_schema(operation_callable) |
There was a problem hiding this comment.
We support activities having access to an agent context as the first param but I am concerned Nexus operation limitations of single param forbid having context as the first param and input as the second. Suggestions? I think we may just have to document for now that tools backed by Nexus operations can't have access to context at this time.
There was a problem hiding this comment.
I think that is ok since we provide nexus_operation_as_tool as a convenience method. You should still be able to define a regular function tool, grab what you need from the context, and invoke the Nexus operation from there.
There was a problem hiding this comment.
Agreed behavior is ok, it's just the optics are confusing/inconsistent. "So, in-workflow tools can have mutable context, activity tools can have immutable context, and nexus tools can have no context?" We need to document this at least I think.
tconley1428
left a comment
There was a problem hiding this comment.
I would like to see the tests left intact, but otherwise looks good.
| """Error that occurs when a tool output could not be serialized.""" | ||
|
|
||
|
|
||
| def activity_as_tool( |
There was a problem hiding this comment.
This file got removed, now located in temporal_openai_agents.workflow
| ), | ||
| openai_agents.workflow.activity_as_tool( | ||
| get_weather_country, start_to_close_timeout=timedelta(seconds=10) | ||
| nexus_operation_as_tool( |
There was a problem hiding this comment.
We should add the tool and extend the test to call it rather than replacing one.
Good call @tconley1428, done that. |
f329f07 to
4db4051
Compare
4db4051 to
f501b66
Compare
451d5c6 to
beb684a
Compare
Add a Nexus operation version of
activity_as_tool.