astonishing-horse-62951
10/02/2025, 7:25 AMtall-airline-16756
10/02/2025, 7:25 AMtall-airline-16756
10/02/2025, 7:25 AMastonishing-horse-62951
10/02/2025, 7:27 AMtall-airline-16756
10/02/2025, 7:28 AM__interrupt__ command, the interrupt() method is your go-to solution. Let me walk you through two friendly approaches:
• Using `session.interrupt()`: This handy method stops the currently active speech, whether triggered programmatically or through external input. For example: session.interrupt()
• Using `SpeechHandle.interrupt()`: When you start speech with session.say() or generate_reply(), you get a SpeechHandle. Calling .interrupt() on this handle will immediately stop the playback: handle = session.say("This is a long message...")
handle.interrupt()
Both of these methods work even if you set allow_interruptions=False when starting the speech. Plus, LiveKit is designed to automatically interrupt when it detects user speech, smoothly switching the agent to a "listening" state. If you find interruptions aren’t working as expected, please double-check that the __interrupt__ command is properly triggering the interrupt() method, and take a look at the logs for any errors. We're here to help you get it working perfectly! Sources: Bringing AI avatars to voice agents | Bringing AI avatars to voice agents | Turn detection and interruptions | LiveKit Docs | livekit-agents/livekit/agents/voice/agent_activity.py | Docs::Agents