bitter-cpu-44145
11/04/2025, 1:27 PMtall-airline-16756
11/04/2025, 1:28 PMtall-airline-16756
11/04/2025, 1:28 PMturn_detection: "manual" when creating your AgentSession docs.
Core methods to control turns:
• session.interrupt() — programmatically interrupt the agent (e.g., when the user starts talking) docs.
• session.clear_user_turn() — start/continue the user’s turn docs.
• session.commit_user_turn() — signal end of the user’s turn to let the agent respond docs.
Typical Node.js flow:
1. Create an AgentSession with turn_detection: "manual".
2. From your UI (e.g., push-to-talk), call backend endpoints that invoke:
◦ clear_user_turn() when the user begins speaking
◦ commit_user_turn() when they release the button/end speech
◦ interrupt() if you need to stop the agent mid-response
If you’re mixing with realtime models or STT plugins, ensure turn detection is handled by your agent when using manual mode docs.
Would you like a minimal Node.js + frontend push-to-talk example that wires these calls together?
Sources: Turn detection and interruptions | LiveKit Docs | Building voice agents | LiveKit Docs | LiveKit turn detector plugin | LiveKit Docs | Text and transcriptions | LiveKit docs | Pipeline nodes and hooks | LiveKit docs