polite-dog-12152
09/14/2025, 7:53 AMtall-airline-16756
09/14/2025, 7:53 AMtall-airline-16756
09/14/2025, 7:53 AMsession.update_options()
in LiveKit. The exact parameters you can change depend on the plugin you're working with:
• Google Realtime API: You can update parameters like voice
, temperature
, and tool_choice
. Just a heads-up, updating instructions
might need a session restart.
• OpenAI Realtime API: Parameters such as voice
, temperature
, turn_detection
, tool_choice
, and more can be updated smoothly without restarting the session.
• Gladia STT: You have the flexibility to update a variety of parameters like languages
, translation_enabled
, and custom_vocabulary
, which will affect all active streams.
• Deepgram STT: Parameters including language
, model
, interim_results
, and keywords
can be updated for all active streams as well.
If you'd like, I’m here to help with more details about any specific plugin or parameter—just let me know!
Sources: livekit-agents/livekit/agents/voice/agent_activity.pypolite-dog-12152
09/14/2025, 8:17 AMtall-airline-16756
09/14/2025, 8:18 AMupdate_options(language=...)
directly on the STT (Speech-to-Text) and TTS (Text-to-Speech) components of your agent, instead of using session.update_options()
. This helps ensure everything switches smoothly.
Here’s a simple example to guide you:
async def _switch_language(self, language_code: str):
if self.tts is not None:
self.tts.update_options(language=language_code)
if self.stt is not None:
self.stt.update_options(language=language_code)
await self.session.say(f"Switched to {language_code}")
This way, both the transcription and voice output languages get updated dynamically. If you want to see this in action, there’s a helpful example in the Change Language recipe.
And of course, if you’d like a hand implementing this or have any questions about a specific plugin, just reach out—I’m here to help!
Sources: Hume TTS integration guide | LiveKit Docs | pipeline-tts/elevenlabs_change_language.py | livekit-plugins/livekit-plugins-google/livekit/plugins/google/stt.py | LiveKit Docs