Skip to content

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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Conversation

dandavison
Copy link
Contributor

No description provided.

@dandavison dandavison requested a review from a team as a code owner June 10, 2025 23:53
@dandavison dandavison marked this pull request as draft June 10, 2025 23:53
Comment on lines +76 to +79
if isinstance(tool, FileSearchTool):
return cast(FileSearchTool, tool)
elif isinstance(tool, WebSearchTool):
return cast(WebSearchTool, tool)
Copy link
Member

@Sushisource Sushisource Jun 11, 2025

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:
Copy link
Member

@Sushisource Sushisource Jun 11, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants