colossal-manchester-31772
08/13/2025, 10:04 PMtall-airline-16756
08/13/2025, 10:04 PMtall-airline-16756
08/13/2025, 10:04 PMaudio_enabled=False
in RoomOutputOptions
. This way, the agent will send text responses without any speech.
• Interrupt Speech: You can stop the agent from speaking anytime by using the interrupt()
method on the speech handle or session. For example:
handle = session.say("Hello world")
handle.interrupt()
# or
session.interrupt()
• Preemptive Generation: Turn on preemptive_generation=True
in the session options to have responses generated based on partial input, which helps cut down on waiting time.
If you want me to walk you through any of these with more details or code examples, just let me know—I’m here to help!
Sources: Agent speech and audio | LiveKit Docs | livekit-agents/livekit/agents/voice/agent_activity.py | Text and transcriptions | LiveKit Docscolossal-manchester-31772
08/13/2025, 10:06 PMtall-airline-16756
08/13/2025, 10:06 PMsession.interrupt()
, it stops the current speech generation and keeps only the part of the message that was delivered before the interruption. The rest of the message won’t be sent to the client.
If you want to make sure the whole response gets through even after an interruption, you’ll need to handle that extra step manually. Just let me know if you’d like some help with how to do that—I’m happy to guide you!
Sources: Turn detection and interruptions | LiveKit Docs | examples/voice_agents/push_to_talk.py