How to change STT provider dynamically during a session

This question originally came up in our Slack community and the thread has been consolidated here for long-term reference.

Is there a method to change the STT provider on the fly?

I tried initiating a new provider in self._stt to override the previous one, but does this reliably ensure the new STT instance is being used?

Also, does session.update_agent() kill the previous agent?

To switch STT provider entirely, you need to switch to a different agent using session.update_agent().

See this example showing how to switch between two agents:

You can configure each agent with a different STT provider. Calling update_agent() replaces the currently running agent with the new one.