Confirm that `on_user_turn_completed(self, chat_ct...
# ask-ai
f
Confirm that
on_user_turn_completed(self, chat_ctx, new_message)
is invoked after the final transcript is committed but before the agent replies
t
Thanks for reaching out, Muthana. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey there! The
on_user_turn_completed(self, chat_ctx, new_message)
method kicks in right after the user's final transcript is saved but just before the agent crafts its reply. This gives you a handy chance to tweak the message or context before the agent responds. Pretty neat, right? Sources: Pipeline nodes and hooks | LiveKit Docs | Voice pipeline nodes | LiveKit Docs | tests/test_agent_session.py | Agent speech and audio | LiveKit Docs