mysterious-van-40803
08/10/2025, 12:47 AMtall-airline-16756
08/10/2025, 12:47 AMtall-airline-16756
08/10/2025, 12:47 AMstt = deepgram.STT(model="nova-2", language="es", detect_language=False)
2. Update the TTS Plugin: Make sure your Text-to-Speech (TTS) plugin uses the same language. For example: tts = elevenlabs.TTS(model="eleven_turbo_v2_5", language="es")
3. Disable Language Detection: Be sure to explicitly set detect_language
to False
in the STT setup to keep things consistent.
4. Provider-Specific Configurations: Double-check that both your STT and TTS plugins support the language you picked, and that it works smoothly with your LLM model.
Here’s a quick example to make it clearer:
from livekit.agents import AgentSession
from livekit.plugins import deepgram, elevenlabs
# Set STT to Spanish
stt = deepgram.STT(model="nova-2", language="es", detect_language=False)
# Set TTS to Spanish
tts = elevenlabs.TTS(model="eleven_turbo_v2_5", language="es")
session = AgentSession(
turn_detection=MultilingualModel(),
stt=stt,
tts=tts,
# ... other configurations
)
This way, your language settings stay consistent all through the pipeline. If you have any questions or want me to walk you through it, just let me know—I’m here to help!
Sources: LiveKit turn detector plugin | LiveKit Docs | pipeline-tts/elevenlabs_change_language.py | livekit-agents/livekit/agents/voice/agent_activity.pymysterious-van-40803
08/10/2025, 12:48 AMtall-airline-16756
08/10/2025, 12:49 AMfrom livekit.plugins.openai import realtime
from openai.types.beta.realtime.session import InputAudioTranscription
model = realtime.RealtimeModel(
input_audio_transcription=InputAudioTranscription(
model="gpt-4o-mini-transcribe",
language="es" # Spanish language code
)
)
2. Update Language Dynamically: Want to switch languages during your session? No problem! Use the update_options
method like this: session = model.session()
session.update_options(
input_audio_transcription=InputAudioTranscription(
model="gpt-4o-mini-transcribe",
language="fr" # French language code
)
)
Just make sure the model supports the language you choose and use the standard language codes (like "en" for English, "es" for Spanish). If you hit any bumps or have more questions, feel free to ask—I’m here to help!
Sources: livekit-plugins/livekit-plugins-openai/README.md