tall-lamp-50063
09/20/2025, 7:38 PMtall-airline-16756
09/20/2025, 7:38 PMtall-airline-16756
09/20/2025, 7:38 PMsendText by setting the allow_interruptions parameter to False when you call session.say(). This way, the agent’s speech won’t stop abruptly when new text messages come in, making the experience much more pleasant.
Here’s a simple example to guide you:
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,
}
);
And if you’d like even more control, such as setting a minimum duration or word count before interruptions can happen, you can easily configure min_interruption_duration and min_interruption_words right in the AgentSession constructor.
Sources: Agent speech and audio | LiveKit Docs | Agent speech and audio | LiveKit Docs | Text and transcriptions | LiveKit Docs | Text and transcriptions | LiveKit Docs | Turn detection and interruptions | LiveKit Docstall-lamp-50063
09/20/2025, 7:43 PMtall-airline-16756
09/20/2025, 7:44 PMlk.chat for text messages and lk.transcription for speech transcriptions, which is pretty neat. However, when it comes to interruption behavior, it’s managed at the session level and applies to all input sources together. So, unfortunately, you can’t set separate interruption behaviors for user speech and sendText updates based on their topics.
If you’re looking to have distinct interruption logic for these inputs, a good approach would be to handle that within your application. For instance, you might route sendText updates to a custom topic and then manage them differently in your app’s logic—this way, you can make sure they don’t trigger interruptions. I hope this helps! Feel free to ask if you want to dive deeper into this.
Sources: livekit-agents/livekit/agents/voice/agent_activity.py | Text and transcriptions | LiveKit Docs | Docs::Agents | Turn detection and interruptions | LiveKit Docs