big-controller-60015
05/09/2025, 10:42 AMtall-airline-16756
05/09/2025, 10:42 AMtall-airline-16756
05/09/2025, 10:43 AMAGENT_SPEECH_INTERRUPTED event (event type 6 in the VPAEvent enumeration) in your application.
• Manual interruption handling: Use the session.interrupt() method to manually interrupt the agent session. This will immediately end any active agent speech and truncate the context to include only the speech heard before the interruption. For example, you can implement this in custom event handlers, such as when a new participant joins a room:
# Interrupt the agent's current response whenever someone joins the room
@ctx.room.on("participant_connected")
def on_participant_connected(participant: rtc.RemoteParticipant):
session.interrupt()
When an interruption occurs, the agent stops speaking and switches to listening mode, storing the position of the speech played so far in its ChatContext.
Sources: VPAEvent | LiveKit Agents | Turn detection and interruptions | LiveKit Docs