important-garden-60239
09/04/2025, 12:05 PMtall-airline-16756
09/04/2025, 12:05 PMtall-airline-16756
09/04/2025, 12:06 PMsession.interrupt() to pause the agent.
Here’s a simple example to get you started:
@session.on("user_input_transcribed")
def on_transcript(transcript: UserInputTranscribedEvent):
if transcript.is_final and transcript.transcript.strip().lower() in ["stop", "pause", "help"]:
session.interrupt()
This way, you have full control over which phrases can interrupt the agent. If you want me to help you with a more detailed setup or anything else, just let me know—I’m here for you!
Sources: Agent speech and audio | LiveKit Docs | Turn detection and interruptions | LiveKit Docsimportant-garden-60239
09/04/2025, 1:04 PM