dazzling-greece-44016
08/23/2025, 1:19 AMtall-airline-16756
08/23/2025, 1:19 AMtall-airline-16756
08/23/2025, 1:19 AMTrue by default, letting users jump in and interrupt the agent mid-speech. If you want to keep things uninterrupted, just set it to False.
• min_interruption_duration: This is the minimum amount of speech (in seconds) that needs to be detected before an interruption kicks in (default is 0.5).
• min_interruption_words: The fewest number of words that need to be transcribed before we consider the interruption intentional (default is 0).
• min_endpointing_delay: This is the wait time before we decide the user has finished speaking (default is 0.5).
2. Control Interruptions During Speech:
When you use session.say() to get the agent talking, you can choose if that specific message can be interrupted or not:
await session.say(
"Hello. How can I help you today?",
allow_interruptions=False # This message won’t be interrupted
)
3. Manual Interruption:
If you ever need to jump in and stop the agent right away, you can use session.interrupt(). It’ll halt any speech happening and trim the context to just what was actually heard.
4. SpeechHandle Configuration:
Every speech action uses a SpeechHandle, which you can set up to allow or block interruptions. When you create a SpeechHandle, there’s an allow_interruptions option that’s True by default.
If you want me to walk you through any part of this or have other questions, just let me know—I’m here to help!
Sources: Turn detection and interruptions | LiveKit Docs | Configuring turn detection and interruptions | LiveKit Docs | Agent speech | LiveKit Docs | Turn detection and interruptions | LiveKit Docs | tests/test_agent_session.py