Title: How to pass `language` param in TTS string ...
# inference
f
Title: How to pass
language
param in TTS string descriptor for
AgentSession
? Question: Hi everyone, I'm setting up an
AgentSession
using LiveKit Inference. I know I can configure TTS using the shorthand string descriptor like this: session = AgentSession( # Format: provider/model:voice_id tts="elevenlabs/eleven_turbo_v2_5:Xb7hH8MSUJpSbSDYk0k2", # ... llm, stt, vad, etc. ) However, I also need to specify the
language
option (e.g., forcing
"en"
or another language code). I know I can achieve this by importing
inference
and instantiating the object explicitly: from livekit.agents import AgentSession, inference session = AgentSession( tts=inference.TTS( model="elevenlabs/eleven_turbo_v2_5", voice="Xb7hH8MSUJpSbSDYk0k2", language="en" # <--- This is what I need ), # ... ) Is there a way to pass this
language
option directly in the string descriptor format?
(e.g., something like
"elevenlabs/eleven_turbo_v2_5:voice_id?language=en"
)? Or is the object-based instantiation the only way to handle parameters beyond just the model and voice ID? Thanks!
r
It is not supported in the TTS from_model_string today. So this is the method you will need to use.
f
it is not supported in the TTS from_model_string today. in future?
r
Good question. I am not sure on that