Skip to content

Commit 5cc0347

Browse files
authored
Merge branch 'openai:main' into freeznet/allow-mcp-customize-handler
2 parents 24a7ecf + f3cac17 commit 5cc0347

File tree

107 files changed

+12051
-742
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+12051
-742
lines changed

.github/workflows/issues.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ jobs:
1515
days-before-issue-stale: 7
1616
days-before-issue-close: 3
1717
stale-issue-label: "stale"
18+
exempt-issue-labels: "skip-stale"
1819
stale-issue-message: "This issue is stale because it has been open for 7 days with no activity."
1920
close-issue-message: "This issue was closed because it has been inactive for 3 days since being marked as stale."
2021
any-of-issue-labels: 'question,needs-more-info'
2122
days-before-pr-stale: 10
2223
days-before-pr-close: 7
2324
stale-pr-label: "stale"
24-
exempt-issue-labels: "skip-stale"
25+
exempt-pr-labels: "skip-stale"
2526
stale-pr-message: "This PR is stale because it has been open for 10 days with no activity."
2627
close-pr-message: "This PR was closed because it has been inactive for 7 days since being marked as stale."
2728
repo-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/update-docs.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,20 @@ name: "Update Translated Docs"
55
# 2. When you add a new page to the left-hand menu, **make sure to manually update mkdocs.yml** to include the new item.
66
# 3. If you switch to a different LLM (for example, from o3 to a newer model), be sure to conduct thorough testing before making the switch.
77

8+
# To add more languages, you will update the following:
9+
# 1. Add '!docs/{lang}/**' to `on.push.paths` in this file
10+
# 2. Update mkdocs.yml to have the new language
11+
# 3. Update docs/scripts/translate_docs.py to have the new language
12+
813
on:
914
push:
1015
branches:
1116
- main
1217
paths:
1318
- 'docs/**'
1419
- mkdocs.yml
20+
- '!docs/ja/**'
21+
- '!docs/ko/**'
1522

1623
permissions:
1724
contents: write

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,6 @@ cython_debug/
144144
# PyPI configuration file
145145
.pypirc
146146
.aider*
147+
148+
# Redis database files
149+
dump.rdb

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ pip install openai-agents
3131

3232
For voice support, install with the optional `voice` group: `pip install 'openai-agents[voice]'`.
3333

34+
For Redis session support, install with the optional `redis` group: `pip install 'openai-agents[redis]'`.
35+
3436
### uv
3537

3638
If you're familiar with [uv](https://docs.astral.sh/uv/), using the tool would be even similar:
@@ -42,6 +44,8 @@ uv add openai-agents
4244

4345
For voice support, install with the optional `voice` group: `uv add 'openai-agents[voice]'`.
4446

47+
For Redis session support, install with the optional `redis` group: `uv add 'openai-agents[redis]'`.
48+
4549
## Hello world example
4650

4751
```python
@@ -211,8 +215,13 @@ print(result.final_output) # "Approximately 39 million"
211215
```python
212216
from agents import Agent, Runner, SQLiteSession
213217

214-
# Custom SQLite database file
218+
# SQLite - file-based or in-memory database
215219
session = SQLiteSession("user_123", "conversations.db")
220+
221+
# Redis - for scalable, distributed deployments
222+
# from agents.extensions.memory import RedisSession
223+
# session = RedisSession.from_url("user_123", url="redis://localhost:6379/0")
224+
216225
agent = Agent(name="Assistant")
217226

218227
# Different session IDs maintain separate conversation histories

docs/agents.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def get_weather(city: str) -> str:
2222
agent = Agent(
2323
name="Haiku agent",
2424
instructions="Always respond in haiku form",
25-
model="o3-mini",
25+
model="gpt-5-nano",
2626
tools=[get_weather],
2727
)
2828
```
@@ -163,7 +163,7 @@ By using the `clone()` method on an agent, you can duplicate an Agent, and optio
163163
pirate_agent = Agent(
164164
name="Pirate",
165165
instructions="Write like a pirate",
166-
model="o3-mini",
166+
model="gpt-4.1",
167167
)
168168

169169
robot_agent = pirate_agent.clone(

docs/examples.md

Lines changed: 72 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,88 @@
22

33
Check out a variety of sample implementations of the SDK in the examples section of the [repo](https://github.com/openai/openai-agents-python/tree/main/examples). The examples are organized into several categories that demonstrate different patterns and capabilities.
44

5-
65
## Categories
76

8-
- **[agent_patterns](https://github.com/openai/openai-agents-python/tree/main/examples/agent_patterns):**
9-
Examples in this category illustrate common agent design patterns, such as
7+
- **[agent_patterns](https://github.com/openai/openai-agents-python/tree/main/examples/agent_patterns):**
8+
Examples in this category illustrate common agent design patterns, such as
9+
10+
- Deterministic workflows
11+
- Agents as tools
12+
- Parallel agent execution
13+
- Conditional tool usage
14+
- Input/output guardrails
15+
- LLM as a judge
16+
- Routing
17+
- Streaming guardrails
18+
19+
- **[basic](https://github.com/openai/openai-agents-python/tree/main/examples/basic):**
20+
These examples showcase foundational capabilities of the SDK, such as
21+
22+
- Hello world examples (Default model, GPT-5, open-weight model)
23+
- Agent lifecycle management
24+
- Dynamic system prompts
25+
- Streaming outputs (text, items, function call args)
26+
- Prompt templates
27+
- File handling (local and remote, images and PDFs)
28+
- Usage tracking
29+
- Non-strict output types
30+
- Previous response ID usage
31+
32+
- **[customer_service](https://github.com/openai/openai-agents-python/tree/main/examples/customer_service):**
33+
Example customer service system for an airline.
34+
35+
- **[financial_research_agent](https://github.com/openai/openai-agents-python/tree/main/examples/financial_research_agent):**
36+
A financial research agent that demonstrates structured research workflows with agents and tools for financial data analysis.
37+
38+
- **[handoffs](https://github.com/openai/openai-agents-python/tree/main/examples/handoffs):**
39+
See practical examples of agent handoffs with message filtering.
40+
41+
- **[hosted_mcp](https://github.com/openai/openai-agents-python/tree/main/examples/hosted_mcp):**
42+
Examples demonstrating how to use hosted MCP (Model Context Protocol) connectors and approvals.
43+
44+
- **[mcp](https://github.com/openai/openai-agents-python/tree/main/examples/mcp):**
45+
Learn how to build agents with MCP (Model Context Protocol), including:
1046

11-
- Deterministic workflows
12-
- Agents as tools
13-
- Parallel agent execution
47+
- Filesystem examples
48+
- Git examples
49+
- MCP prompt server examples
50+
- SSE (Server-Sent Events) examples
51+
- Streamable HTTP examples
1452

15-
- **[basic](https://github.com/openai/openai-agents-python/tree/main/examples/basic):**
16-
These examples showcase foundational capabilities of the SDK, such as
53+
- **[memory](https://github.com/openai/openai-agents-python/tree/main/examples/memory):**
54+
Examples of different memory implementations for agents, including:
1755

18-
- Dynamic system prompts
19-
- Streaming outputs
20-
- Lifecycle events
56+
- SQLite session storage
57+
- Advanced SQLite session storage
58+
- Redis session storage
59+
- SQLAlchemy session storage
60+
- Encrypted session storage
61+
- OpenAI session storage
2162

22-
- **[tool examples](https://github.com/openai/openai-agents-python/tree/main/examples/tools):**
23-
Learn how to implement OAI hosted tools such as web search and file search,
24-
and integrate them into your agents.
63+
- **[model_providers](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers):**
64+
Explore how to use non-OpenAI models with the SDK, including custom providers and LiteLLM integration.
2565

26-
- **[model providers](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers):**
27-
Explore how to use non-OpenAI models with the SDK.
66+
- **[realtime](https://github.com/openai/openai-agents-python/tree/main/examples/realtime):**
67+
Examples showing how to build real-time experiences using the SDK, including:
2868

29-
- **[handoffs](https://github.com/openai/openai-agents-python/tree/main/examples/handoffs):**
30-
See practical examples of agent handoffs.
69+
- Web applications
70+
- Command-line interfaces
71+
- Twilio integration
3172

32-
- **[mcp](https://github.com/openai/openai-agents-python/tree/main/examples/mcp):**
33-
Learn how to build agents with MCP.
73+
- **[reasoning_content](https://github.com/openai/openai-agents-python/tree/main/examples/reasoning_content):**
74+
Examples demonstrating how to work with reasoning content and structured outputs.
3475

35-
- **[customer_service](https://github.com/openai/openai-agents-python/tree/main/examples/customer_service)** and **[research_bot](https://github.com/openai/openai-agents-python/tree/main/examples/research_bot):**
36-
Two more built-out examples that illustrate real-world applications
76+
- **[research_bot](https://github.com/openai/openai-agents-python/tree/main/examples/research_bot):**
77+
Simple deep research clone that demonstrates complex multi-agent research workflows.
3778

38-
- **customer_service**: Example customer service system for an airline.
39-
- **research_bot**: Simple deep research clone.
79+
- **[tools](https://github.com/openai/openai-agents-python/tree/main/examples/tools):**
80+
Learn how to implement OAI hosted tools such as:
4081

41-
- **[voice](https://github.com/openai/openai-agents-python/tree/main/examples/voice):**
42-
See examples of voice agents, using our TTS and STT models.
82+
- Web search and web search with filters
83+
- File search
84+
- Code interpreter
85+
- Computer use
86+
- Image generation
4387

44-
- **[realtime](https://github.com/openai/openai-agents-python/tree/main/examples/realtime):**
45-
Examples showing how to build realtime experiences using the SDK.
88+
- **[voice](https://github.com/openai/openai-agents-python/tree/main/examples/voice):**
89+
See examples of voice agents, using our TTS and STT models, including streamed voice examples.

docs/guardrails.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,4 +151,4 @@ async def main():
151151
1. This is the actual agent's output type.
152152
2. This is the guardrail's output type.
153153
3. This is the guardrail function that receives the agent's output, and returns the result.
154-
4. This is the actual agent that defines the workflow.
154+
4. This is the actual agent that defines the workflow.

0 commit comments

Comments
 (0)