Hey, I want to determine the TTS node end event so...
# ask-ai
a
Hey, I want to determine the TTS node end event so that after some delay if user does not say something, we can prompt user from our side something like 'are you still there' message like that
t
Thanks for reaching out, bhargav. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Here’s a friendly way to add a delay-based prompt right after your user finishes speaking: 1. Detect the End of Speech: Keep an eye on the
END_OF_SPEECH
event from LiveKit’s STT component. This handy event lets you know when the user has stopped talking, based on the
min_endpointing_delay
you set up. 2. Introduce a Delay: You can tweak the delay by adjusting the
min_endpointing_delay
parameter in your agent constructor. This controls how long the system waits before deciding the user’s done speaking. 3. Use the Callback: The
on_user_turn_completed
callback is your friend here—it lets you run some code right after the user’s turn wraps up. Perfect for adding that little pause before you jump in. 4. Trigger TTS Prompt: Once the delay is over, use your TTS system to gently ask, “Are you still there?”—a nice way to keep the conversation flowing. By playing around with the delay and keeping an eye on metrics like
end_of_utterance_delay
, you’ll create a smooth, natural experience that feels really responsive to your users. Sources: AI voice agents | LiveKit Docs | Capturing metrics | LiveKit Docs | AI Agents Framework | livekit/livekit_composite | DeepWiki
a
actually after user speaks the assistant will also speak so if I were to use these methods then it will say 'are you still there' right after the end of the assistant speech because the delay we set up will be completed in the duration of assitant speech. Ideally we want to see after ssistants speech end if there is no speech from user after some time, then we will ask 'are you still there'
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!