Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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 1 commit into from
Jun 12, 2025
Merged

Allow to pass timeout as float #941

merged 1 commit into from
Jun 12, 2025

Conversation

Kludex
Copy link
Member

@Kludex Kludex commented Jun 12, 2025

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.


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,
Copy link
Member Author

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.

@Kludex Kludex requested review from dsp-ant, a team and ihrpr June 12, 2025 06:46
Copy link
Member

@samuelcolvin samuelcolvin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@Kludex Kludex merged commit 20dc0fb into main Jun 12, 2025
12 checks passed
@Kludex Kludex deleted the use-float-and-timedelta branch June 12, 2025 07:31
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.
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.

Inconsistent timeout and sse_read_timeout Types in sse_client and streamablehttp_client
2 participants