brief-vase-33757
08/29/2025, 3:56 AMtall-airline-16756
08/29/2025, 3:56 AMtall-airline-16756
08/29/2025, 3:57 AMAgentSession
. Here’s a quick example:
session = AgentSession(
stt=deepgram.STT(model="nova-3", language="multi"),
llm=openai.LLM(model="gpt-4o-mini"),
tts=cartesia.TTS(model="sonic-2", voice="f786b574-daa5-4673-aa0c-cbe3e8534c02"), # This part is important!
vad=silero.VAD.load(),
turn_detection=MultilingualModel(),
)
Just double-check that the TTS model you pick works well with your setup. Some popular options are Cartesia, Deepgram, ElevenLabs, Google Gemini, and a few others. Each one needs specific details like model
and voice
to work properly.
If you want, I’m here to help you get the TTS model configured correctly—just give me a shout!
Sources: Deepgram TTS integration guide | LiveKit Docs | ElevenLabs TTS integration guide | LiveKit Docs | Gemini TTS integration guide | LiveKit Docs | livekit-agents/livekit/agents/voice/generation.py | Agent speech and audio | LiveKit Docsbrief-vase-33757
08/29/2025, 3:58 AMtall-airline-16756
08/29/2025, 3:59 AMAgentSession
, it’s important to set it up for text-only output and add a separate TTS plugin for turning that text into speech. Here’s a friendly little guide to get you started:
from livekit.agents import AgentSession
from livekit.plugins import openai
session = AgentSession(
llm=openai.realtime.RealtimeModel(modalities=["text"]), # Text-only output
tts=openai.TTS(voice="ash") # Add a TTS plugin
)
This way, your realtime model focuses on generating text responses, and the TTS plugin takes care of converting those into speech. You’ve got options like OpenAI, Cartesia, Deepgram, and more for TTS.
If you want a hand picking the right TTS provider or tweaking any settings, just give me a shout—I’m here to help!
Sources: Text-to-speech (TTS) integrations | LiveKit Docs | OpenAI Realtime API integration guide | LiveKit Docs | Turn detection and interruptions | LiveKit Docs | OpenAI TTS integration guide | LiveKit Docs | Realtime model integrations | LiveKit Docs