big-controller-60015
07/14/2025, 8:20 AMtall-airline-16756
07/14/2025, 8:20 AMtall-airline-16756
07/14/2025, 8:21 AMmin_interruption_words
in LiveKit Agents v1.x controls how many words must be spoken (with speech-to-text enabled) for the system to treat user speech as an intentional interruption of the agent.
• Configuration: Set min_interruption_words
when creating an `AgentSession`—for example:`from livekit.agents import AgentSession
session = AgentSession(
min_interruption_words=3, # Requires at least 3 words to interrupt
# ...other params
)`
• How It Works:
◦ The system first checks if speech duration exceeds min_interruption_duration
(default 0.5s).
◦ If STT is enabled and min_interruption_words
is set (>0), it checks the current transcript’s word count using split_words(text, split_character=True)
.
◦ If the transcript has fewer words than this value, interruption won’t trigger.
• Notes:
◦ This parameter only has an effect if STT is enabled.
◦ The default is 0 (any speech can interrupt if duration threshold is met).
◦ Setting a higher value can reduce accidental interruptions by brief utterances, but may introduce latency awaiting transcription.
This allows you to tune interruption sensitivity when running agents in version 1.x.
Sources: livekit-agents/livekit/agents/voice/agent.py