what’s the behavior of user turn completed node wh...
# ask-ai
b
what’s the behavior of user turn completed node when assistant’s answer was interrupted to continue the previous answer?
t
Thanks for reaching out, mateuszkasprowicz. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I understand that when the assistant's answer gets interrupted, it might feel a bit confusing. Here’s what happens behind the scenes to keep things running smoothly: • If interruptions are allowed, the current assistant speech will stop right away. • The
on_user_turn_completed
lifecycle hook then steps in to process your new input, giving a chance to adjust the context or your message if needed. • After that, the system crafts a fresh response based on the updated conversation history, which includes the interrupted response flagged as 'interrupted' along with your new input. • Finally, the LLM decides the best way to move forward—whether that’s restarting, summarizing, or continuing the conversation so it feels natural and clear. This approach helps ensure our conversation stays coherent and responsive to your needs, even when interruptions happen. I hope this clarifies things for you! Sources: agents/src/voice/agent_activity.ts | Pipeline nodes and hooks | LiveKit docs | livekit-agents/livekit/agents/voice/agent_activity.py | Agent speech and audio | LiveKit docs