View Simple Agent Example on GitHub
Check out the complete Simple Agent example in our GitHub repository
Complete the Quickstart first. This example uses a custom pipeline (not Realtime mode) — see Voice Agents for the same pattern with additional providers.
What You Will Build
- Listen to user speech and convert it to text with Deepgram STT
- Process conversations using Gemini with function calling (weather tool)
- Respond with natural-sounding speech via ElevenLabs TTS
- Run on Stream’s low-latency edge network
Prerequisites
API keys for Stream, Gemini, Deepgram, and ElevenLabs. Free tiers are available from each provider.Run the example
Clone and install
Clone the repo and install dependencies from the root:
Configure environment
Create a
.env file at the repo root with your API keys (see Prerequisites above).Run the agent
From the example directory:The CLI opens a browser demo. Join the call and speak to the agent. Ask about the weather to trigger the registered
get_weather function.How it works
The agent uses a custom pipeline instead of a Realtime model:eager_turn_detection=True reduces latency by starting LLM inference before the user fully stops speaking.
Customize
- Swap providers: any STT, LLM, and TTS plugin works — see Integrations.
- Use Realtime instead: replace the pipeline with
llm=gemini.Realtime()and removesttandtts— same pattern as the Quickstart. - Add processors: pass items to
processors=[]for video analysis — see AI Golf Coach.
Next Steps
AI Golf Coach
Add video processing with YOLO pose detection
Voice Agents
Custom pipelines and function calling
Integrations
Swap in any of 35+ supported AI providers