cool-lizard-26153
11/18/2025, 12:02 PMtall-airline-16756
11/18/2025, 12:02 PMtall-airline-16756
11/18/2025, 12:03 PMself.session.say method can indeed be interrupted programmatically if you want to start reading a different text. You can do this by using the interrupt() method on the session or on the handle returned by say(). Let me show you how:
Python Example:
# Interrupt the current speech
self.session.interrupt()
# Start reading different text
self.session.say("I'm sorry, that will take too long to say.")
Node.js Example:
const handle = session.say('Hello world');
handle.interrupt();
// or from the session
session.interrupt();
Also, you have control over whether a say() operation can be interrupted by setting the allow_interruptions parameter. Here's an example:
# Python
await session.say(
"Hello. How can I help you today?",
allow_interruptions=False,
)
// Node.js
await session.say(
'Hello. How can I help you today?',
{
allowInterruptions: false,
}
);
Just so you know, even if allow_interruptions is set to False, you can still explicitly interrupt the agent using the interrupt() method. If you have any more questions or need further clarification, feel free to ask—I’m here to help!
Sources: Turn detection and interruptions | LiveKit Docs | basics/say_in_voice.py | Agent speech and audio | LiveKit docsbig-controller-60015
11/18/2025, 12:16 PMtall-airline-16756
11/18/2025, 12:18 PMallow_interruptions flag is set to False for the speech generation handle. No worries though, you have a couple of straightforward options to fix this:
1. Make Sure Interruptions Are Allowed:
# When scheduling speech, set allow_interruptions to True
handle = session.generate_reply("Your message", allow_interruptions=True)
2. Use the force Parameter:
If you want to override the allow_interruptions setting, you can use the force parameter with the interrupt() method like this:
# Python
self.session.interrupt(force=True)
# Or for a specific handle
handle.interrupt(force=True)
// Node.js
session.interrupt(true);
// Or for a specific handle
handle.interrupt(true);
By using force=True, you’re making sure the interruption happens even if allow_interruptions is set to False. If you have any more questions or need further assistance, feel free to ask—I’m here to support you!
Sources: plugins/google/src/beta/realtime/realtime_api.ts | Turn detection and interruptions | LiveKit Docs | livekit-plugins/livekit-plugins-ultravox/livekit/plugins/ultravox/realtime/... | pipeline-llm/interrupt_user.pybig-controller-60015
11/18/2025, 1:18 PMtall-airline-16756
11/18/2025, 1:18 PM