bland-helicopter-77642
08/26/2025, 12:38 PMtall-airline-16756
08/26/2025, 12:38 PMtall-airline-16756
08/26/2025, 12:39 PMinterrupt() method. Here’s how:
• Using `session.interrupt()`: This will stop the current speech and, if you want, clear the whole speech queue by setting interrupt_all=True. For example:
session.interrupt(interrupt_all=True)
• Using a Speech Handle: If you have a specific speech reference, you can interrupt it directly like this:
handle = session.say("Hello world")
handle.interrupt()
Once you’ve interrupted the agent and want to pick things back up, just call session.generate_reply(). This will create a new response based on the latest context.
Also, if you’d like the agent to automatically resume after a false interruption (like if there’s no meaningful user input after stopping), you can turn on agent_false_interruption_timeout in your session settings. Here’s an example:
session = AgentSession(agent_false_interruption_timeout=3.0)
@session.on("agent_false_interruption")
def on_false_interruption(ev):
session.generate_reply(instructions=ev.extra_instructions)
Feel free to reach out if you want me to walk you through anything else!
Sources: Turn detection and interruptions | LiveKit Docs | VoicePipelineAgent | LiveKit Docs | Agent speech and audio | LiveKit Docs | VoicePipelineAgent | LiveKit Docs | Agent speech and audio | LiveKit Docs