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](https://github.com/modelcontextprotocol/python-sdk/pull/941),
updating the MCP version in openai-agents and specifying the timeouts as
floats should be enough.
Now that `ModelSettings` has `Reasoning`, a non-primitive object,
`dataclasses.as_dict()` wont work. It will raise an error when you try
to serialize (e.g. for tracing). This ensures the object is actually
serializable.
litellm is a library that abstracts away details/differences for a lot
of model providers. Adding an extension, so that any provider can easily
be integrated.
---
[//]: # (BEGIN SAPLING FOOTER)
* #532
* __->__ #524
I fixed the type annotations errors for pydantic objects in some
examples as noted in #490 .
When running `make lint` the following error occurs "UP007 Use `X | Y`
for type annotations". If you know how to ignore it I will be happy to
edit the pull request, thanks.
Summary:
1. Use <2 for MCP version so it doesn't break if the MCP sdk upgrades.
2. Test the func schema extraction logic.
3. Fix the logic to get the version nuber of the framework
Test Plan:
unit tests
### Summary:
1. Add the MCP dep for python 3.10, since it doesn't support 3.9 and below
2. Create MCPServer, which is the agents SDK representation of an MCP server
3. Create implementations for HTTP-SSE and StdIO servers, directly copying the [MCP SDK example](https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/clients/simple-chatbot/mcp_simple_chatbot/main.py)
4. Add a util to transform MCP tools into Agent SDK tools
Note: I added optional caching support to the servers. That way, if you happen to know a server's tools don't change, you can just cache them.
### Test Plan:
Checks pass. I added tests at the end of the stack.