are livekit agents able to interrupt the user voic...
# ask-ai
n
are livekit agents able to interrupt the user voice and vice versa ??
t
Thanks for reaching out, Vinay. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Yes, LiveKit supports bidirectional interruptions, meaning both users and agents can interrupt each other during conversations. User Interrupting Agent: • Users can interrupt agents automatically through speech detection or programmatically using the
session.interrupt()
method. • Interruption behavior can be configured using parameters such as: ◦ `allowInterruptions`: Enables or disables user interruptions. ◦ `interruptMinWords`: Sets the minimum number of words required for an interruption to be considered intentional. ◦ `interruptSpeechDuration`: Specifies the minimum speech duration for intentional interruptions. Agent Interrupting User: • Agents can interrupt users based on specific conditions, such as the number of sentences spoken by the user. • Programmatic methods like
session.say()
can be used to interrupt users, with options to temporarily disable user interruptions during the agent's response. When interruptions occur, the system automatically adjusts the conversation history to reflect only the speech heard before the interruption, ensuring smooth interaction. Sources: Turn detection and interruptions | LiveKit Docs | Configuring turn detection and interruptions | LiveKit Docs | livekit-agents/livekit/agents/voice/agent_activity.py | pipeline-llm/interrupt_user.py | Bringing AI avatars to voice agents