@@ -9,20 +9,29 @@ Check out a variety of sample implementations of the SDK in the examples section
99
1010 - Deterministic workflows
1111 - Agents as tools
12+ - Agents as tools with streaming events (` examples/agent_patterns/agents_as_tools_streaming.py ` )
13+ - Agents as tools with structured input parameters (` examples/agent_patterns/agents_as_tools_structured.py ` )
1214 - Parallel agent execution
1315 - Conditional tool usage
16+ - Forcing tool use with different behaviors (` examples/agent_patterns/forcing_tool_use.py ` )
1417 - Input/output guardrails
1518 - LLM as a judge
1619 - Routing
1720 - Streaming guardrails
21+ - Human-in-the-loop with tool approval and state serialization (` examples/agent_patterns/human_in_the_loop.py ` )
22+ - Human-in-the-loop with streaming (` examples/agent_patterns/human_in_the_loop_stream.py ` )
1823 - Custom rejection messages for approval flows (` examples/agent_patterns/human_in_the_loop_custom_rejection.py ` )
1924
2025- ** [ basic] ( https://github.com/openai/openai-agents-python/tree/main/examples/basic ) :**
2126 These examples showcase foundational capabilities of the SDK, such as
2227
2328 - Hello world examples (Default model, GPT-5, open-weight model)
2429 - Agent lifecycle management
30+ - Run hooks and agent hooks lifecycle example (` examples/basic/lifecycle_example.py ` )
2531 - Dynamic system prompts
32+ - Basic tool usage (` examples/basic/tools.py ` )
33+ - Tool input/output guardrails (` examples/basic/tool_guardrails.py ` )
34+ - Image tool output (` examples/basic/image_tool_output.py ` )
2635 - Streaming outputs (text, items, function call args)
2736 - Responses websocket transport with a shared session helper across turns (` examples/basic/stream_ws.py ` )
2837 - Prompt templates
@@ -40,10 +49,18 @@ Check out a variety of sample implementations of the SDK in the examples section
4049 A financial research agent that demonstrates structured research workflows with agents and tools for financial data analysis.
4150
4251- ** [ handoffs] ( https://github.com/openai/openai-agents-python/tree/main/examples/handoffs ) :**
43- See practical examples of agent handoffs with message filtering.
52+ Practical examples of agent handoffs with message filtering, including:
53+
54+ - Message filter example (` examples/handoffs/message_filter.py ` )
55+ - Message filter with streaming (` examples/handoffs/message_filter_streaming.py ` )
4456
4557- ** [ hosted_mcp] ( https://github.com/openai/openai-agents-python/tree/main/examples/hosted_mcp ) :**
46- Examples demonstrating how to use hosted MCP (Model Context Protocol) connectors and approvals.
58+ Examples demonstrating how to use hosted MCP (Model Context Protocol) with the OpenAI Responses API, including:
59+
60+ - Simple hosted MCP without approval (` examples/hosted_mcp/simple.py ` )
61+ - MCP connectors such as Google Calendar (` examples/hosted_mcp/connectors.py ` )
62+ - Human-in-the-loop with interruption-based approvals (` examples/hosted_mcp/human_in_the_loop.py ` )
63+ - On-approval callback for MCP tool calls (` examples/hosted_mcp/on_approval.py ` )
4764
4865- ** [ mcp] ( https://github.com/openai/openai-agents-python/tree/main/examples/mcp ) :**
4966 Learn how to build agents with MCP (Model Context Protocol), including:
@@ -52,7 +69,13 @@ Check out a variety of sample implementations of the SDK in the examples section
5269 - Git examples
5370 - MCP prompt server examples
5471 - SSE (Server-Sent Events) examples
72+ - SSE remote server connection (` examples/mcp/sse_remote_example ` )
5573 - Streamable HTTP examples
74+ - Streamable HTTP remote connection (` examples/mcp/streamable_http_remote_example ` )
75+ - Custom HTTP client factory for Streamable HTTP (` examples/mcp/streamablehttp_custom_client_example ` )
76+ - Prefetching all MCP tools with ` MCPUtil.get_all_function_tools ` (` examples/mcp/get_all_mcp_tools_example ` )
77+ - MCPServerManager with FastAPI (` examples/mcp/manager_example ` )
78+ - MCP tool filtering (` examples/mcp/tool_filter_example ` )
5679
5780- ** [ memory] ( https://github.com/openai/openai-agents-python/tree/main/examples/memory ) :**
5881 Examples of different memory implementations for agents, including:
@@ -66,6 +89,11 @@ Check out a variety of sample implementations of the SDK in the examples section
6689 - OpenAI Conversations session storage
6790 - Responses compaction session storage
6891 - Stateless Responses compaction with ` ModelSettings(store=False) ` (` examples/memory/compaction_session_stateless_example.py ` )
92+ - File-backed session storage (` examples/memory/file_session.py ` )
93+ - File-backed session with human-in-the-loop (` examples/memory/file_hitl_example.py ` )
94+ - SQLite in-memory session with human-in-the-loop (` examples/memory/memory_session_hitl_example.py ` )
95+ - OpenAI Conversations session with human-in-the-loop (` examples/memory/openai_session_hitl_example.py ` )
96+ - HITL approval/rejection scenario across sessions (` examples/memory/hitl_session_scenario.py ` )
6997
7098- ** [ model_providers] ( https://github.com/openai/openai-agents-python/tree/main/examples/model_providers ) :**
7199 Explore how to use non-OpenAI models with the SDK, including custom providers and third-party adapters.
@@ -79,7 +107,11 @@ Check out a variety of sample implementations of the SDK in the examples section
79107 - Twilio SIP integration using Realtime Calls API attach flows
80108
81109- ** [ reasoning_content] ( https://github.com/openai/openai-agents-python/tree/main/examples/reasoning_content ) :**
82- Examples demonstrating how to work with reasoning content and structured outputs.
110+ Examples demonstrating how to work with reasoning content, including:
111+
112+ - Reasoning content with the Runner API, streaming and non-streaming (` examples/reasoning_content/runner_example.py ` )
113+ - Reasoning content with OSS models via OpenRouter (` examples/reasoning_content/gpt_oss_stream.py ` )
114+ - Basic reasoning content example (` examples/reasoning_content/main.py ` )
83115
84116- ** [ research_bot] ( https://github.com/openai/openai-agents-python/tree/main/examples/research_bot ) :**
85117 Simple deep research clone that demonstrates complex multi-agent research workflows.
@@ -90,6 +122,9 @@ Check out a variety of sample implementations of the SDK in the examples section
90122 - Web search and web search with filters
91123 - File search
92124 - Code interpreter
125+ - Apply patch tool with file editing and approval (` examples/tools/apply_patch.py ` )
126+ - Shell tool execution with approval callbacks (` examples/tools/shell.py ` )
127+ - Shell tool with human-in-the-loop interruption-based approvals (` examples/tools/shell_human_in_the_loop.py ` )
93128 - Hosted container shell with inline skills (` examples/tools/container_shell_inline_skill.py ` )
94129 - Hosted container shell with skill references (` examples/tools/container_shell_skill_reference.py ` )
95130 - Local shell with local skills (` examples/tools/local_shell_skill.py ` )
0 commit comments