This question originally came up in our Slack community and the thread has been consolidated here for long-term reference.
Is it possible to update the turn detection used by the agent during runtime?
I tried assigning agent._turn_detection = "manual" from "stt" but the agent still speaks, so I’m assuming it’s not working.
Directly modifying the _turn_detection attribute (like agent._turn_detection = "manual") is not the recommended approach, as it may not trigger the necessary internal state changes within the agent.
You should configure the turn detection when initializing the AgentSession or use the appropriate methods to manage the state.
If you need to change it dynamically while the agent is running, you may need to stop the current session and start a new one with the desired configuration, as the turn detection mode is typically set at the time of session creation.