aloof-scooter-47164
10/11/2025, 12:50 AMtall-airline-16756
10/11/2025, 12:50 AMtall-airline-16756
10/11/2025, 12:51 AMagent = VoiceAgent(
instructions="You are a helpful assistant",
llm=RealtimeModel(model="gpt-4o-realtime"),
stt=DeepgramSTT(model="nova-2"),
vad=SileroVAD(),
tts=CartesiaTTS(voice="sonic-2"),
)
This way, your Realtime model can focus on understanding and generating speech, while the STT plugin takes care of the transcription in real time. If you have any questions or want me to walk you through the setup, just let me know—I’m here to help!
Sources: Realtime model plugins | LiveKit Docs | livekit-agents/livekit/agents/llm/realtime.py | Turn detection and interruptions | LiveKit Docs | complex-agents/nutrition-assistant/README.mdaloof-scooter-47164
10/11/2025, 12:52 AMtall-airline-16756
10/11/2025, 12:53 AMsession.say with Realtime models.
Here’s a simple way to set it up:
1. Set the Realtime model to text-only mode by specifying modalities=["text"].
2. Integrate a TTS provider to generate the audio responses. Some popular options include Cartesia, ElevenLabs, Rime, and others.
Here’s an example configuration you can try:
agent = VoiceAgent(
instructions="You are a helpful assistant",
llm=RealtimeModel(modalities=["text"], model="gpt-4o-realtime"),
tts=CartesiaTTS(voice="sonic-2"),
)
This setup lets the Realtime model focus on crafting the text responses, while the TTS engine takes care of turning those into audio. If you have any questions or need a hand with this setup, just let me know—I’m here to help!
Sources: livekit-agents/livekit/agents/voice/agent_activity.py | Realtime model plugins | LiveKit Docs | OpenAI Realtime API plugin guide | LiveKit Docs | Azure OpenAI Realtime API and LiveKit | LiveKit Docs | Text-to-speech (TTS) models | LiveKit Docsaloof-scooter-47164
10/11/2025, 12:55 AMtall-airline-16756
10/11/2025, 12:56 AMclass HybridAgent(Agent):
async def specific_task_function(self, task_type: str):
return f"Handling {task_type} with controlled TTS output."
1. Multi-Agent Handoff: If you want even more precise control, you can create separate agents—one dedicated to TTS-specific tasks and another for general Realtime tasks—and switch between them dynamically using agent handoffs.
This approach helps you enjoy the best of both worlds, integrating TTS exactly where you need it while keeping the Realtime model’s strengths for everything else. If you’d like, I’m here to provide more details or examples to make this even clearer!
Sources: examples/voice_agents/realtime_turn_detector.py | README.md | Realtime model plugins | LiveKit Docs