Hi, does anyone know if it is possible, and if so ...
# agents
b
Hi, does anyone know if it is possible, and if so how, to update the turn detection used by the agent during run time?
I tried assigning agent._turn_detection = "manual" from being "stt" but the agent still speaks so I'm assuming it is not working
r
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. Instead, 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.
b
Thanks, I was hoping for that to not be the case. Not sure, what side effects I would introduce by cutting and starting the session mid-conversation so I'll just probably make a workaround
c
We would be interested in this capability mid session for the openai realtime API ,as I believe their API supports it but as you say I think currently livekit does not An example use case is to elegantly disable ability for user to interrupt the model mid session (livekit does not support the allow_interruptions argument for the realtime API)