in livekit agents how can we switch between the ST...
# ask-ai
b
in livekit agents how can we switch between the STT model in the middle of the call?
t
Thanks for reaching out, Mohammed. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey there! If you want to switch between STT models in LiveKit agents during a call, you can easily update the model configuration programmatically. Here’s a quick rundown on how to do it: 1. Start with a Specific STT Model: When you create an agent, just specify which STT model you want to use. For example:
Copy code
# Using Cartesia STT with a specific model
stt = cartesia.STT(
    model="ink-whisper",
    language="en"
)
2. Change the STT Model on the Fly: You can switch models during a call by using the
update_options
method like this:
Copy code
# Switching to a different model
await agent.stt.update_options(
    model="nova-phonecall"
)
3. Switch Between STT Providers: If you want to change the STT provider entirely, just create a new
AgentSession
with the configuration you want:
Copy code
# Switching to a different STT provider
await session.update_agent(
    ShortAgent(
        stt=openai.STT(
            model="gpt-4o-transcribe"
        )
    )
)
If you have a particular STT provider or model in mind, just give me a shout! I’d be happy to help you with some more personalized advice.