Explore various sample implementations of the SDK in the examples section of the repository. These examples are organized into several categories, each demonstrating different patterns and capabilities.
- Agent Patterns
- Basic
- Tools
- Model Providers
- Handoffs
- Customer Service
- Research Bot
- Voice
- Financial Research Agent
Examples in this category illustrate common agent design patterns:
- Agents as Tools – Using agents to accomplish complex tasks via other agents.
- Deterministic Workflows – Creating predictable and repeatable agent behaviors.
- Forcing Tool Use – Ensuring agents utilize specific tools.
- Input Guardrails – Validating and constraining agent inputs.
- LLM as a Judge – Using language models to evaluate agent outputs.
- Output Guardrails – Ensuring agent outputs conform to desired behaviors.
- Parallel Agent Execution – Running multiple agents concurrently.
- Routing – Directing tasks to appropriate agents.
Foundational SDK capabilities:
- Agent Lifecycle Events – Handling different stages of an agent’s lifecycle.
- Dynamic System Prompts – Modifying system prompts dynamically.
- Hello World Examples – Simple implementations to get started.
- Streaming Outputs – Handling streaming responses.
- Tool Integration – Extending agent functionality via tools.
Implementing and integrating tools:
- Web Search Tool – Performing live web searches.
- File Search Tool – Searching within specified files.
- Computer Use Tool – Simulating user interactions with a computer.
Using non-OpenAI models with the SDK:
- Custom Example Agent – Setting up an agent with a custom model provider.
- Custom Example Global – Configuring a global model provider.
- Custom Example Provider – Implementing a provider for specific use cases.
Practical agent handoff scenarios:
- Message Filter – Transferring tasks based on message content.
- Message Filter with Streaming – Handling message filtering with streaming responses.
A real-world example:
- Customer Service System – An airline customer service system handling FAQs and bookings.
A simple multi-agent research bot:
- Research Bot – Assists in gathering and summarizing information.
Explore voice-related agent implementations:
- Voice – General voice processing examples.
- Static Voice – Handling pre-recorded voice data.
- Streamed Voice – Processing real-time voice input.
A specialized example focusing on financial research:
- Financial Research Agent – Assists in financial data analysis and research.
For a comprehensive understanding and to see these examples in action, visit the examples directory in the repository.