is VAD an optional setting in AgentSession
# ask-ai
b
is VAD an optional setting in AgentSession
t
Thanks for reaching out, Sandeep. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Yes, VAD is an optional setting in
AgentSession
. 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.py
b
what is manual?
t
Hey there! Manual turn detection mode in LiveKit lets you take full control over when a user's turn starts and ends during a conversation. This comes in super handy for apps like push-to-talk, where users explicitly signal when they want to speak and when they're done. To get started with manual mode, just set
turn_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