-
Notifications
You must be signed in to change notification settings - Fork 104
OpenAI agents support #898
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
Conversation
… without a change to type deserialization of agent responses
|
||
|
||
@contextmanager | ||
def set_open_ai_agent_temporal_overrides(**kwargs): |
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.
If possible, let's just take typed, listed keyword args for type safety and self-documentability for any args we know about.
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 you are right, but it will take some time. Given the urgency concerns, let's leave that for another version.
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 also agree that it would be good to do this. The SDK does already have many overloads repeating large sets of arguments; would be good to do this in a future PR.
**kwargs: Additional arguments to pass to the TemporalOpenAIRunner constructor. | ||
These arguments are forwarded to workflow.execute_activity_method when | ||
executing model calls. Common options include: | ||
- start_to_close_timeout: Maximum time for the activity to complete |
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.
nit: let's name this something like model_call_start_to_close_timeout so it's clear what these apply to.
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.
That would get a bit unwieldy applying to all the different kwargs, I think we'd be better off documenting them as a set
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 name is too ambiguous as-is. We definitely need to do something here, soon. Johann and I were brainstorming approaches.
search_results = await self._perform_searches(search_plan) | ||
report = await self._write_report(query, search_results) | ||
|
||
print("\n\n=====REPORT=====\n\n") |
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.
use workflow.logger.info() instead of print, to avoid redudant prints upon replay.
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 the effort is more to generalize taking a class like this into temporal. While it is true that the prints might not show up if you are running the workflow on a worker elsewhere, I'm hesitant to pull in a temporal dependency in this file just for logging. The print isn't really important since the result is what matters
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.
Nice, LGTM!
What was changed
Added an experimental
contrib
module to provide compatibility with the OpenAI Agents SDK.Why?
To facilitate durable execution for applications built with the OpenAI Agents SDK
Checklist
Closes
How was this tested:
Tests provided in
tests/contrib/test_openai.py
Any docs updates needed?
README provided. Further updates to the documentation are on hold while this code remains experimental.