Commit graph

6 commits

Author SHA1 Message Date
pakrym-oai
0cf503e1c2
Allow replacing AgentRunner and TraceProvider (#720) 2025-06-17 17:41:10 -07:00
Niv Hertz
8dfd6ff35c
Added support for passing tool_call_id via the RunContextWrapper (#766)
This PR fixes issue:
https://github.com/openai/openai-agents-python/issues/559

By adding the tool_call_id to the RunContextWrapper prior to calling
tools. This gives the ability to access the tool_call_id in the
implementation of the tool.
2025-06-09 11:08:50 -04:00
Rohan Mehta
4046fcb3fa
Add is_enabled to FunctionTool (#808)
### Summary:
Allows a user to do `function_tool(is_enabled=<some_callable>)`; the
callable is called when the agent runs.

This allows you to dynamically enable/disable a tool based on the
context/env.

The meta-goal is to allow `Agent` to be effectively immutable. That
enables some nice things down the line, and this allows you to
dynamically modify the tools list without mutating the agent.

### Test Plan:
Unit tests
2025-06-03 13:44:16 -04:00
Rohan Mehta
d6f5190d53
Replace referencable_id with response_id (#508)
Minor change - naming. So that it doesn't pollute the next PR.

---
[//]: # (BEGIN SAPLING FOOTER)
* #509
* __->__ #508
2025-04-14 21:37:18 -04:00
Rohan Mehta
68c800d2a3 [2/n] Add MCP support to Runner
### 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.
2025-03-24 15:08:02 -04:00
Rohan Mehta
aaec57a426 Initial commit 2025-03-11 09:42:28 -07:00