Skip to content

Latest commit

 

History

History
298 lines (238 loc) · 8.73 KB

File metadata and controls

298 lines (238 loc) · 8.73 KB

SDK Code Examples Checklist

Use this to verify each code example in the documentation works correctly.


Introduction

Quickstart (introduction/quickstart.mdx)

  • Line 31: Basic agent setup (my_agent.py)
  • Line 54: Running the agent (main.py)

Core Concepts - Events (introduction/core-concepts/events.mdx)

  • Line 25: Event flow overview
  • Line 60: SDKSystemInitEvent
  • Line 71: SDKUserSpeechEvent
  • Line 87: SDKAgentTextEvent
  • Line 109: SDKAgentEndCallEvent
  • Line 123: Custom event handling

Core Concepts - Sessions (introduction/core-concepts/sessions.mdx)

  • Line 23: Session creation
  • Line 42: Session lifecycle
  • Line 82: Session state

Core Concepts - Nodes (introduction/core-concepts/nodes.mdx)

  • Line 30: Node definition
  • Line 54: OutputAgentNode
  • Line 83: Node types - Logger
  • Line 89: Node types - Filter
  • Line 96: Node types - Counter
  • Line 112-139: Logger, Filter, Counter examples
  • Line 160: Node connections
  • Line 180: Advanced node example

Core Concepts - Graphs (introduction/core-concepts/graphs.mdx)

  • Line 32: Graph creation
  • Line 45: Node linking
  • Line 64-91: Graph patterns (Linear, Fork, Join, Diamond)
  • Line 109-176: Graph building examples
  • Line 210: Complex graph

Agent Patterns

Streaming (build/agents/agent-patterns/streaming.mdx)

  • Line 19: Basic streaming
  • Line 35: Streaming with LLM
  • Line 94: Streaming with tools
  • Line 104: Tool execution in stream
  • Line 129: Advanced streaming
  • Line 156: Error handling in streams
  • Line 201: Stream buffering

State Management (build/agents/agent-patterns/state-management.mdx)

  • Line 20: Context basics
  • Line 60: add_message
  • Line 85: add_messages
  • Line 103: get_messages
  • Line 142: Message history
  • Line 168: Truncation
  • Line 187: State persistence
  • Line 219: Complete state example

Interruption Handling (build/agents/agent-patterns/interruption-handling.mdx)

  • Line 17: is_interruptible=True
  • Line 30: is_interruptible=False
  • Line 49: Interruption in stream
  • Line 81: Interruption with tools
  • Line 100: Complete interrupt example
  • Line 139: Non-interruptible section
  • Line 170: Tools and interruptions

Multi-Agent Orchestration (build/agents/agent-patterns/multi-agent-orchestration.mdx)

  • Line 38: Router agent
  • Line 90: Specialist agents
  • Line 135: Agent handoff
  • Line 173: Session routing
  • Line 210: Complete multi-agent
  • Line 249: Dynamic routing
  • Line 267: Context passing

Conversation Flow (build/agents/agent-patterns/conversation-flow-design.mdx)

  • Line 42: Basic flow
  • Line 98: Greeting pattern
  • Line 132: Question handling
  • Line 175: Confirmation flow
  • Line 206: Error recovery
  • Line 235: Complete flow example

Optimization (build/agents/agent-patterns/optimization.mdx)

  • Line 21-284: All optimization patterns (13 examples)

Tools & Functions

Overview (build/agents/tools-functions/overview.mdx)

  • Line 39: Complete tool calling example

Defining Tools (build/agents/tools-functions/defining-tools.mdx)

  • Line 10: @function_tool decorator
  • Line 38: Tool with parameters
  • Line 60: Tool with return type
  • Line 80: Async tool
  • Line 98: Tool with validation
  • Line 114: Complex tool
  • Line 138: Multiple tools

Executing Tools (build/agents/tools-functions/executing-tools.mdx)

  • Line 10: ToolRegistry setup
  • Line 34: get_tools_json()
  • Line 48: Tool execution
  • Line 83: Parallel execution
  • Line 133: Adding results to context

Built-in Tools (build/agents/tools-functions/built-in-tools.mdx)

  • Line 12: from_defaults()
  • Line 30: Built-in end_call
  • Line 73: Complete SupportAgent example

Agent Configuration

Overview (build/agents/agent-configuration/overview.mdx)

  • Line 15: Configuration structure

Prompts (build/agents/agent-configuration/prompts.mdx)

  • Line 10: System prompt
  • Line 43: Role-based prompts
  • Line 60: Task prompts
  • Line 77: Dynamic prompts
  • Line 98-137: Prompt templates

LLM Settings (build/agents/agent-configuration/llm-settings.mdx)

  • Line 10: OpenAI setup
  • Line 39: Temperature
  • Line 51: Max tokens
  • Line 69: Stop sequences
  • Line 85: Streaming config
  • Line 95: Full config

BYOM (build/agents/agent-configuration/byom.mdx)

  • Line 23: OpenAI client
  • Line 53: Groq client
  • Line 77: Together client
  • Line 93: Ollama client

Voice Settings (build/agents/agent-configuration/voice-settings.mdx)

  • Line 35-179: Voice configuration (9 examples)

Building First Agent

Complete Walkthrough (build/agents/building-first-agent/complete-walkthrough.mdx)

  • Line 54: Step 1 - Basic setup
  • Line 102: Step 2 - Add LLM
  • Line 196: Step 3 - Add tools
  • Line 254: Step 4 - Complete agent

Debugging & Testing

Local Testing (build/agents/debugging-testing/local-testing.mdx)

  • Line 39: test_tools.py
  • Line 70: test_response.py
  • Line 102: MockLLMClient
  • Line 132: Multi-turn test
  • Line 169: Environment setup
  • Line 186-196: Debug helpers

Common Issues (build/agents/debugging-testing/common-issues.mdx)

  • Line 23-183: Issue fixes (8 examples)

Logging & Observability (build/agents/debugging-testing/logging-observability.mdx)

  • Line 12-241: Logging patterns (11 examples)

Rate Limits (build/agents/debugging-testing/rate-limits.mdx)

  • Line 27-184: Rate limit handling (5 examples)

Knowledge Base

Overview (build/knowledge-base/overview.mdx)

  • Line 47: Quick upload example

Creating (build/knowledge-base/creating.mdx)

  • Line 11: create_knowledge_base
  • Line 38: get_knowledge_bases
  • Line 48: get_knowledge_base_by_id
  • Line 63: delete_knowledge_base
  • Line 72: Agent's global KB
  • Line 82: Upload to agent's KB

Managing Documents (build/knowledge-base/managing-documents.mdx)

  • Line 13: upload_text_to_knowledge_base
  • Line 59: Upload media
  • Line 84: Bulk upload
  • Line 106: get_knowledge_base_items
  • Line 118: delete_knowledge_base_item
  • Line 133: Update pattern
  • Line 187: Chunking example

Using with Agents (build/knowledge-base/using-with-agents.mdx)

  • Line 27: SupportAgent with KB
  • Line 54: Upload to agent's KB
  • Line 76: System prompt for KB
  • Line 104: Fallback handling
  • Line 119: Testing KB retrieval

Querying & Retrieval (build/knowledge-base/querying-retrieval.mdx)

  • Line 66: Descriptive titles
  • Line 80: Include synonyms
  • Line 105: Complete answers

Best Practices (build/knowledge-base/advanced-troubleshooting.mdx)

  • Line 30: Good content example
  • Line 53: Bad content example
  • Line 72: Categorize content
  • Line 93: Synonyms example
  • Line 113: Automated sync
  • Line 175: Debug retrieval
  • Line 197-217: Common patterns (3)

Calling & Campaigns

Overview (build/phone-calling/overview.mdx)

  • Line 18: start_outbound_call
  • Line 36: create_campaign quick

Outbound Calls (build/phone-calling/outbound-calls.mdx)

  • Line 11: start_outbound_call
  • Line 48: Trigger from user input
  • Line 68: Scheduled callback
  • Line 88: Error handling

Campaigns (build/phone-calling/campaigns.mdx)

  • Line 19: create_campaign
  • Line 51: start_campaign
  • Line 61: pause_campaign
  • Line 71: get_campaigns
  • Line 83: get_campaign_by_id
  • Line 94: delete_campaign
  • Line 116: Complete workflow

Call Logs (build/phone-calling/call-logs.mdx)

  • Line 11: get_conversation_logs
  • Line 40: Transcript analysis
  • Line 75: Export logs

Analytics

Overview (build/analytics/overview.mdx)

  • Line 22: Quick example
  • Line 41: Available data fields

Call Metrics (build/analytics/call-metrics.mdx)

  • Line 11: Get logs
  • Line 29: Duration
  • Line 40: Status
  • Line 55: Call types
  • Line 68: Phone numbers
  • Line 80: Transcripts
  • Line 91: Recording URL
  • Line 102: Batch analysis
  • Line 124: Export

Agent Performance (build/analytics/agent-performance.mdx)

  • Line 21: Latency data
  • Line 53: check_performance
  • Line 97: Agent details
  • Line 109: Quality report

Summary

Section Code Examples
Introduction 15
Agent Patterns 45+
Tools & Functions 15
Agent Configuration 20+
Building First Agent 4
Debugging & Testing 25+
Knowledge Base 20+
Calling & Campaigns 15
Analytics 10
Total ~170