brief-vase-33757
08/27/2025, 5:37 AMtall-airline-16756
08/27/2025, 5:37 AMtall-airline-16756
08/27/2025, 5:37 AMAgentSession. You can include it when you’re setting up the session, but it’s totally okay if you don’t. If you leave it out, the session will still work just fine, and the system might use other turn detection modes like stt, realtime_llm, or manual, depending on what components are available.
Sources: examples/other/transcription/translator.pybrief-vase-33757
08/27/2025, 5:45 AMtall-airline-16756
08/27/2025, 5:46 AMturn_detection="manual" when you initialize the AgentSession. Usually, you'll want to disable audio input at the beginning using session.input.set_audio_enabled(False) so it doesn’t listen by accident. From there, you can manage turns with simple client-side actions:
• Start Turn: Call session.interrupt() to pause any ongoing agent speech, then use session.input.set_audio_enabled(True) to start capturing the user’s audio.
• End Turn: When the user’s done, just call session.input.set_audio_enabled(False) to stop listening, and session.commit_user_turn() to wrap up their input and get the agent’s response going.
If you want to see it all in action, check out the push-to-talk.py example in the LiveKit agents repo. It’s a great way to get a feel for how it works!
Sources: Turn detection and interruptions | LiveKit Docs | Turn detection and interruptions | LiveKit Docs | livekit-agents/livekit/agents/voice/agent.py