Pass api params into prepare_request#320
Closed
fizzyagent wants to merge 1 commit intoopenai:mainfrom
Closed
Conversation
Collaborator
|
Closing this because #369 fixed it |
safa0
pushed a commit
to safa0/openai-agents-python
that referenced
this pull request
Apr 27, 2025
We don't really need mypy on 3.9 (unit tests would catch any real issues), and it causes issues with the rest of this stack. --- [//]: # (BEGIN SAPLING FOOTER) * openai#324 * openai#322 * openai#321 * openai#320 * __->__ openai#319
safa0
pushed a commit
to safa0/openai-agents-python
that referenced
this pull request
Apr 27, 2025
### 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. --- openai#324 openai#322 openai#321 -> openai#320 openai#319
safa0
pushed a commit
to safa0/openai-agents-python
that referenced
this pull request
Apr 27, 2025
### Summary: This enables users to **use** MCP inside the SDK. 1. You add a list of MCP servers to `Agent`, via `mcp_server=[...]` 2. When an agent runs, we look up its MCP tools and add them to the list of tools. 3. When a tool call occurs, we call the relevant MCP server. Notes: 1. There's some refactoring to make sure we send the full list of tools to the Runner/Model etc. 2. Right now, you could have a locally defined tool that conflicts with an MCP defined tool. I didn't add errors for that, will do in a followup. ### Test Plan: See unit tests. Also has an end to end example next PR. --- [//]: # (BEGIN SAPLING FOOTER) * openai#324 * openai#322 * __->__ openai#321 * openai#320
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
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.
Fix for issue #303
Originally, the Audio endpoint does not pass the api_key into the request
This fixes the error by passing the
api_keyparam, as well as other api-related params, into the_prepare_requestmethod.