-
Notifications
You must be signed in to change notification settings - Fork 103
OpenAI agents prototype #896
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
if isinstance(tool, FileSearchTool): | ||
return cast(FileSearchTool, tool) | ||
elif isinstance(tool, WebSearchTool): | ||
return cast(WebSearchTool, tool) |
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.
This is all a bit suspicious to me. cast
doesn't actually do anything except signal to the type checker that a type is a certain type. I don't think this would survive over the serialization boundary.
The corresponding bit here https://github.com/temporalio/sdk-python/pull/896/files#diff-4d31f8abb21e7ac3886618347fb821f5a2679c41146ce9363c20166b913b0bc2R137 is similarly a bit funky. I think the isinstance
checks after deserialization are made to work via the custom converter: https://github.com/temporalio/sdk-python/pull/896/files#diff-7307f8c289cf7271f54f43ba96cdd40af15e7aacf1989d6d27785dfbeb62ff5fR67
So maybe the casting is just to ensure the converter does the right thing, but, it reads a bit funny.
) | ||
|
||
|
||
def set_open_ai_agent_temporal_overrides() -> TemporalTraceProvider: |
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.
This is an example of something I'd definitely expect to change long run. Possibly this could be implemented instead as a worker-level workflow interceptor which intercepts execute_workflow
. I don't know that we need to do that now.
No description provided.