Skip to main content

Examples / Recipes

The Piopiy Voice AI Orchestrator includes a variety of examples located in the example/ folder of the repository. These examples demonstrate how to build voice agents using different combinations of LLM, ASR, and TTS providers.

Getting Started with Examples

Each example is designed to be runnable. Before running them, ensure you have:

  1. Installed the SDK with the relevant provider extras.
  2. Set your AGENT_ID and AGENT_TOKEN in your environment.
  3. Set the required API keys for the providers used in the example.
# Example setup
export AGENT_ID="your_agent_id"
export AGENT_TOKEN="your_agent_token"
export OPENAI_API_KEY="your_openai_key"

# Run an example
python example/basic/basic.py

Available Examples

ExampleFolderLLMASRTTS / SpeechHighlights
Voice Assistantexample/voice_assistant/OpenAIDeepgramCartesiaSimple, clean voice assistant template.
Phone Agentexample/phone_agent/OpenAIDeepgramCartesiaOutbound programmable server calling template.
Tool Calling Agentexample/tool_calling_agent/OpenAIDeepgramCartesiaDefines Python tools that the LLM invokes mid-call.
Call Transferexample/call_transfer/OpenAIDeepgramCartesiaHand off a live call to a human expert.
Switch Providersexample/switch_providers/MultiDeepgramMultiDynamically switch TTS mid-conversation.
MCP Salesexample/mcp_sales/OpenAIDeepgramCartesiaSearch external knowledge bases using MCP.
Basic Loopexample/basic/OpenAIDeepgramCartesiaMinimal voice loop showcasing Silero VAD.
Chatterboxexample/chatterbox/OpenAIDeepgramOpenAIUses OpenAI for both LLM and TTS.
Tool Usage (Weather)example/function_calling/OpenAIDeepgramCartesiaSimple tool-calling workflow for weather.
Sales Assistant (CRM)example/function_calling/OpenAIDeepgramCartesiaCRM assistant with structured tool outputs.
MCP Knowledgeexample/mcp_sales/OpenAIDeepgramCartesiaAdds Model Context Protocol (MCP) tools.
Open Source Stackexample/chatterbox/OllamaWhisperChatterboxFully local/open-source stack.
Offline TTSexample/kokoro/OllamaWhisperKokoroOffline TTS using Kokoro ONNX models.
Provider Switchingexample/switch_providers/MultipleMultipleMultipleDemonstrates hot-swapping ASR/TTS.
High Quality Voiceexample/murf/OpenAIDeepgramMurf.aiIntegration with Murf.ai premium voices.
Ultravox Omniexample/ultravox/Ultravox-CartesiaUsing an all-in-one speech-to-speech model.

Use the navigation menu on the left to explore the detailed code, configuration, and step-by-step guides for each of these examples. All examples are fully open source and available in the telecmi/agents repository.