-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Allow to pass timeout as float #941
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
Merged
Merged
+16
−28
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Kludex
commented
Jun 12, 2025
headers: dict[str, Any] | None = None, | ||
timeout: timedelta = timedelta(seconds=30), | ||
sse_read_timeout: timedelta = timedelta(seconds=60 * 5), | ||
headers: dict[str, str] | None = 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.
The values are not Any
, they are str
.
samuelcolvin
approved these changes
Jun 12, 2025
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.
Lgtm
rm-openai
pushed a commit
to openai/openai-agents-python
that referenced
this pull request
Jun 16, 2025
I replaced the `timedelta` parameters for MCP timeouts with `float` values, addressing issue #845 . Given that the MCP official repository has incorporated these changes in [this PR](modelcontextprotocol/python-sdk#941), updating the MCP version in openai-agents and specifying the timeouts as floats should be enough.
niv-hertz
pushed a commit
to coralogix/openai-agents-python
that referenced
this pull request
Jun 20, 2025
I replaced the `timedelta` parameters for MCP timeouts with `float` values, addressing issue openai#845 . Given that the MCP official repository has incorporated these changes in [this PR](modelcontextprotocol/python-sdk#941), updating the MCP version in openai-agents and specifying the timeouts as floats should be enough.
niv-hertz
added a commit
to coralogix/openai-agents-python
that referenced
this pull request
Jun 23, 2025
* Fix function_schema name override bug (openai#872) ## Summary - ensure `name_override` is always used in `function_schema` - test name override when docstring info is disabled ## Testing - `make format` - `make lint` - `make mypy` - `make tests` Resolves openai#860 ------ https://chatgpt.com/codex/tasks/task_i_684f1cf885b08321b4dd3f4294e24ca2 * adopted float instead of timedelta for timeout parameters (openai#874) I replaced the `timedelta` parameters for MCP timeouts with `float` values, addressing issue openai#845 . Given that the MCP official repository has incorporated these changes in [this PR](modelcontextprotocol/python-sdk#941), updating the MCP version in openai-agents and specifying the timeouts as floats should be enough. * Prompts support (openai#876) Add support for the new openai prompts feature. * v0.0.18 (openai#878) * Allow replacing AgentRunner and TraceProvider (openai#720) * Prepare 0.0.19 release (openai#895) * Added support for "return" handoffs (#1) * Fix bug in Reasoning with `store=False` --------- Co-authored-by: Rohan Mehta <[email protected]> Co-authored-by: Daniele Morotti <[email protected]> Co-authored-by: pakrym-oai <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I personally think that
timedelta
adds an unnecessary complexity, and is inconsistent with the SSE implementation. Even if it's considered the "right type", I don't think those timeouts should be used with any other unit than seconds/milliseconds.I'm implementing it like this because it is the least breaking change, and @dsp-ant said he'd prefer it.