|
2 | 2 |
|
3 | 3 | 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.
|
4 | 4 |
|
5 |
| - |
6 | 5 | ## Categories
|
7 | 6 |
|
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 |
10 |
| - |
11 |
| - - Deterministic workflows |
12 |
| - - Agents as tools |
13 |
| - - Parallel agent execution |
14 |
| - - Conditional tool usage |
15 |
| - - Input/output guardrails |
16 |
| - - LLM as a judge |
17 |
| - - Routing |
18 |
| - - Streaming guardrails |
19 |
| - |
20 |
| -- **[basic](https://github.com/openai/openai-agents-python/tree/main/examples/basic):** |
21 |
| - These examples showcase foundational capabilities of the SDK, such as |
22 |
| - |
23 |
| - - Hello world examples (GPT-4, GPT-5, Open Source) |
24 |
| - - Agent lifecycle management |
25 |
| - - Dynamic system prompts |
26 |
| - - Streaming outputs (text, items, function call args) |
27 |
| - - Prompt templates |
28 |
| - - File handling (local and remote, images and PDFs) |
29 |
| - - Usage tracking |
30 |
| - - Non-strict output types |
31 |
| - - Previous response ID usage |
32 |
| - |
33 |
| -- **[customer_service](https://github.com/openai/openai-agents-python/tree/main/examples/customer_service):** |
34 |
| - Example customer service system for an airline. |
35 |
| - |
36 |
| -- **[financial_research_agent](https://github.com/openai/openai-agents-python/tree/main/examples/financial_research_agent):** |
37 |
| - A financial research agent that demonstrates structured research workflows with agents and tools for financial data analysis. |
38 |
| - |
39 |
| -- **[handoffs](https://github.com/openai/openai-agents-python/tree/main/examples/handoffs):** |
40 |
| - See practical examples of agent handoffs with message filtering. |
41 |
| - |
42 |
| -- **[hosted_mcp](https://github.com/openai/openai-agents-python/tree/main/examples/hosted_mcp):** |
43 |
| - Examples demonstrating how to use hosted MCP (Model Context Protocol) connectors and approvals. |
44 |
| - |
45 |
| -- **[mcp](https://github.com/openai/openai-agents-python/tree/main/examples/mcp):** |
46 |
| - Learn how to build agents with MCP (Model Context Protocol), including: |
47 |
| - |
48 |
| - - Filesystem examples |
49 |
| - - Git examples |
50 |
| - - Prompt server |
51 |
| - - SSE (Server-Sent Events) examples |
52 |
| - - Streamable HTTP examples |
53 |
| - |
54 |
| -- **[memory](https://github.com/openai/openai-agents-python/tree/main/examples/memory):** |
55 |
| - Examples of different memory implementations for agents, including: |
56 |
| - |
57 |
| - - SQLite session storage |
58 |
| - - Advanced SQLite session storage |
59 |
| - - Redis session storage |
60 |
| - - SQLAlchemy session storage |
61 |
| - - Encrypted session storage |
62 |
| - - OpenAI session storage |
63 |
| - |
64 |
| -- **[model_providers](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers):** |
65 |
| - Explore how to use non-OpenAI models with the SDK, including custom providers and LiteLLM integration. |
66 |
| - |
67 |
| -- **[realtime](https://github.com/openai/openai-agents-python/tree/main/examples/realtime):** |
68 |
| - Examples showing how to build real-time experiences using the SDK, including: |
69 |
| - |
70 |
| - - Web-based applications |
71 |
| - - Command-line interfaces |
72 |
| - - Twilio integration |
73 |
| - |
74 |
| -- **[reasoning_content](https://github.com/openai/openai-agents-python/tree/main/examples/reasoning_content):** |
75 |
| - Examples demonstrating how to work with reasoning content and structured outputs. |
76 |
| - |
77 |
| -- **[research_bot](https://github.com/openai/openai-agents-python/tree/main/examples/research_bot):** |
78 |
| - Simple deep research clone that demonstrates complex multi-agent research workflows. |
79 |
| - |
80 |
| -- **[tools](https://github.com/openai/openai-agents-python/tree/main/examples/tools):** |
81 |
| - Learn how to implement OAI hosted tools such as: |
82 |
| - |
83 |
| - - Web search and web search with filters |
84 |
| - - File search |
85 |
| - - Code interpreter |
86 |
| - - Computer use |
87 |
| - - Image generation |
88 |
| - |
89 |
| -- **[voice](https://github.com/openai/openai-agents-python/tree/main/examples/voice):** |
90 |
| - See examples of voice agents, using our TTS and STT models, including streamed voice examples. |
| 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: |
| 46 | + |
| 47 | + - Filesystem examples |
| 48 | + - Git examples |
| 49 | + - MCP prompt server examples |
| 50 | + - SSE (Server-Sent Events) examples |
| 51 | + - Streamable HTTP examples |
| 52 | + |
| 53 | +- **[memory](https://github.com/openai/openai-agents-python/tree/main/examples/memory):** |
| 54 | + Examples of different memory implementations for agents, including: |
| 55 | + |
| 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 |
| 62 | + |
| 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. |
| 65 | + |
| 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: |
| 68 | + |
| 69 | + - Web applications |
| 70 | + - Command-line interfaces |
| 71 | + - Twilio integration |
| 72 | + |
| 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. |
| 75 | + |
| 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. |
| 78 | + |
| 79 | +- **[tools](https://github.com/openai/openai-agents-python/tree/main/examples/tools):** |
| 80 | + Learn how to implement OAI hosted tools such as: |
| 81 | + |
| 82 | + - Web search and web search with filters |
| 83 | + - File search |
| 84 | + - Code interpreter |
| 85 | + - Computer use |
| 86 | + - Image generation |
| 87 | + |
| 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. |
0 commit comments