Commit graph

235 commits

Author SHA1 Message Date
Rohan Mehta
300e12c198 [1/n] Add MCP types to the SDK
### 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.
2025-03-24 15:08:02 -04:00
Rohan Mehta
a7a6fe715f [0/n] Only run tests on py3.9, not mypy
### Summary:
We don't need to run mypy on 3.9 anyway. Also it causes issues with the rest of this stack.

### Test plan:

run checks
2025-03-24 15:08:02 -04:00
Rohan Mehta
486b4e87e5
[docs] fix annotation numbering in context management (#293)
Fix inconsistent numbering between code and explanatory annotations in
the context management documentation.
2025-03-21 19:33:30 -04:00
Rohan Mehta
136e2b49ba
Fix circular dependency in voice streamed example by renaming agents #291 (#292)
Fix circular dependency in voice streamed example by renaming agents.py
to my_workflow.py

Fix circular dependency in voice streamed example by renaming agents
#291
2025-03-21 19:33:12 -04:00
Aviral Garg
fdf340495b Fix circular dependency in voice streamed example with cleaner import pattern 2025-03-21 16:26:19 -07:00
Aviral Garg
9473c788ba Fix type-checking for circular dependency in voice streamed example 2025-03-21 16:18:04 -07:00
Rohan Mehta
2439032f4c
Add Weights & Biases to tracing docs (#294) 2025-03-21 17:59:54 -04:00
Rohan Mehta
f4f0b85eb5
Read tracing API data lazily (#289) 2025-03-21 17:58:10 -04:00
Scott Condron
13eca63732
Add Weights & Biases to tracing docs 2025-03-21 21:37:54 +00:00
Han Hwang Lim
d56047be51 fix annotation numbering in context management
Fix inconsistent numbering between code and explanatory annotations in
the context management documentation.
2025-03-21 21:10:30 +00:00
Aviral Garg
7432347a94 Fix circular dependency in voice streamed example by renaming agents.py to my_workflow.py 2025-03-21 13:25:46 -07:00
Dmitry Pimenov
211ffb28c5
fix line in guardrails doc (#290) 2025-03-21 13:00:18 -07:00
James Hills
fa1c3f40a1
fix line in guardrails 2025-03-21 15:58:34 -04:00
Rohan Mehta
c0794a90ec Read tracing API data lazily 2025-03-21 15:32:37 -04:00
Rohan Mehta
090e79bdf4
Replace remaining uses of fetch_ordered_spans and fetch_traces for stronger tests (#288)
Following https://github.com/openai/openai-agents-python/pull/261
2025-03-21 13:25:43 -04:00
Alex Hall
dacbb9ba44 More fetch_normalized_spans 2025-03-21 18:31:06 +02:00
Alex Hall
6b509e33f6 empty assertions 2025-03-21 18:26:04 +02:00
Rohan Mehta
1d3d1ce3f7
Create py.typed (#285)
- Ensure library is properly typehinted
2025-03-21 12:19:48 -04:00
Alex Hall
a00b61f355 More fetch_normalized_spans 2025-03-21 18:15:52 +02:00
Alex Hall
153f703211 More fetch_normalized_spans 2025-03-21 18:14:59 +02:00
Alex Hall
7581696b38 More fetch_normalized_spans 2025-03-21 18:13:04 +02:00
Alex Hall
cb0eb8e254 More fetch_normalized_spans 2025-03-21 18:09:19 +02:00
Richie Caputo
b5305810d7
Create py.typed
- Ensure library is properly typehinted
2025-03-21 11:16:24 -04:00
Rohan Mehta
cd9b9ab28d
Remove redundant weaker tracing assertions (#261)
Following up on https://github.com/openai/openai-agents-python/pull/25,
this removes uses of `fetch_traces` and `fetch_ordered_spans` where
there's already a stronger assertion using `fetch_normalized_spans`.
This is to help move towards the stronger style as much as possible,
since people are still adding weaker assertions such as
[this](7a0ca7930e/tests/test_concurrency.py (L59-L61))
in https://github.com/openai/openai-agents-python/pull/91. The next step
will be to find remaining uses of `fetch_ordered_spans` that can be
replaced.
2025-03-21 10:31:41 -04:00
Rohan Mehta
851f0ce539
docs: add Langfuse to tracing documentation (#284) 2025-03-21 10:31:05 -04:00
Rohan Mehta
59e6834878
fixed from agents.voice import SingleAgentVoiceWorkflow, VoicePipelin… (#275)
…e in  quickstart.md

from agents.voice import SingleAgentVoiceWorkflow, VoicePipeline,

remove extra "," from the first line
2025-03-21 10:29:13 -04:00
Jannik Maierhöfer
37ddc4e5a1
docs: add Langfuse to tracing documentation 2025-03-21 13:39:17 +01:00
Alex Hall
f3296199c4 Merge branch 'main' of github.com:openai/openai-agents-python into alex/cleanup-tests 2025-03-21 10:13:33 +02:00
Sir Qasim
5f7a0b9508
fixed from agents.voice import SingleAgentVoiceWorkflow, VoicePipeline in quickstart.md
from agents.voice import SingleAgentVoiceWorkflow, VoicePipeline,

remove extra "," from the first line
2025-03-21 06:58:47 +05:00
Rohan Mehta
65032208f2
Make the optional dependency installation compatible with zsh (#274) 2025-03-20 21:33:23 -04:00
Kazuhiro Sera
98c4b45b6a Make the optional dependency installation compatible with zsh 2025-03-21 10:01:24 +09:00
Rohan Mehta
180a8ab043
Updating tracing doc for new spans (#272) 2025-03-20 20:05:42 -04:00
Dmitry Pimenov
1b12fce95d fixing object path 2025-03-20 17:03:52 -07:00
Rohan Mehta
ea63a99b61
[doc] fix invalid imports (#273) 2025-03-20 20:03:00 -04:00
Yoshinori Sano
0dd5b37936 [doc] fix invalid imports 2025-03-21 08:37:45 +09:00
Dmitry Pimenov
1f348b8370 fixing whitespace 2025-03-20 16:05:54 -07:00
Dmitry Pimenov
21634f31d5 removing erroneous changes 2025-03-20 15:53:41 -07:00
Dmitry Pimenov
7a4c71f23b include reference to new audio span related concepts 2025-03-20 15:51:02 -07:00
Rohan Mehta
1e8930d6ae
v0.0.6 (voice support) (#267)
Release a new version with voice support
2025-03-20 13:13:00 -04:00
Rohan Mehta
fb8e5c2baf v0.0.6 (voice support) 2025-03-20 13:10:54 -04:00
Rohan Mehta
3af879ec3f
update tests (#266) 2025-03-20 13:10:47 -04:00
Rohan Mehta
1771c1e856 update tests 2025-03-20 13:08:38 -04:00
Rohan Mehta
6f13d50a6e
feat: add voice pipeline support (#265)
> Co-authored-by: rm@openai.com
2025-03-20 12:54:42 -04:00
Dominik Kundel
aec066649c fix tests 2025-03-20 09:52:15 -07:00
Dominik Kundel
c7ce154637 feat: add voice pipeline support
> Co-authored-by: rm@openai.com
2025-03-20 09:43:13 -07:00
Rohan Mehta
1e02b9894d
Indentation for mkdocs.yml (#264) 2025-03-20 11:21:27 -04:00
Rohan Mehta
5c77298a47 Indentation for mkdocs.yml 2025-03-20 11:18:08 -04:00
Rohan Mehta
03dc8f7f82
Adds example for financial agent (#255)
This example shows how you might compose a richer financial research
agent using the Agents SDK. The pattern is similar to the `research_bot`
example, but with more specialized sub‑agents and a verification step.

The flow is:

1. **Planning**: A planner agent turns the end user’s request into a
list of search terms relevant to financial analysis – recent news,
earnings calls, corporate filings, industry commentary, etc.
2. **Search**: A search agent uses the built‑in `WebSearchTool` to
retrieve terse summaries for each search term. (You could also add
`FileSearchTool` if you have indexed PDFs or 10‑Ks.)
3. **Sub‑analysts**: Additional agents (e.g. a fundamentals analyst and
a risk analyst) are exposed as tools so the writer can call them inline
and incorporate their outputs.
4. **Writing**: A writer agent brings together the search snippets and
any sub‑analyst summaries into a long‑form markdown report plus a short
executive summary.
5. **Verification**: A final verifier agent audits the report for
obvious inconsistencies or missing sourcing.
2025-03-20 10:55:31 -04:00
Alex Hall
ea3e8ce230 lint 2025-03-20 13:56:11 +02:00
Alex Hall
7031d4ab87 Remove redundant weaker tracing assertions 2025-03-20 13:49:38 +02:00