chilly-balloon-11273
09/23/2025, 6:35 AMtall-airline-16756
09/23/2025, 6:35 AMtall-airline-16756
09/23/2025, 6:36 AMuser_away_timeout is triggered, you can gently listen for the user_state_changed event to spot when the user's state changes to "away". Here's a simple way to set it up:
1. First, set user_away_timeout in AgentSession to decide how long of inactivity should trigger the message.
2. Next, keep an eye on the user_state_changed event and check if the new_state becomes "away".
3. Then, you can send a friendly custom message using session.generate_reply() to create a TTS response, like "Please repeat what you said."
If you'd prefer to send just a text message instead of TTS, you can use the LiveKit client SDKs on the frontend to send text through text streams. Here's a quick example in JavaScript:
const info = await room.localParticipant.sendText("Please repeat your last statement.", {
topic: "agent.prompts"
});
I'm here to help if you want to walk through this together or have any other questions—just let me know!
Sources: livekit-plugins/livekit-plugins-ultravox/livekit/plugins/ultravox/realtime/... | Events and error handling | LiveKit Docs | Events and error handling | LiveKit Docs | Sending text | LiveKit Docs