I never see "away" become a status. Am I doing som...
# ask-ai
m
I never see "away" become a status. Am I doing somethig wrong? session = AgentSession( stt=deepgram.STT(model="nova-3", language="multi"), llm=openai.LLM(model=llm_model), tts=tts, vad=silero.VAD.load(), turn_detection=EnglishModel(), user_away_timeout=5, # turn_detection=MultilingualModel(), ) @session.on("user_state_changed") def _on_user_state_changed(ev: UserStateChangedEvent): logger.info("User state changed: %s", ev.new_state) if ev.new_state == "away": session.generate_reply(instructions="ask user if they are still there")
t
Thanks for reaching out, Marcus. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
The "away" user state in AgentSession is triggered by a timeout when both the user and agent are in the "listening" state (both are silent) for longer than the user_away_timeout value.The timer only starts when both user and agent are in "listening" state.If either party speaks or changes state, the timer resets or cancels.If user_away_timeout is None, the "away" state is disabled.The timer won't start if the room subscription isn't ready yet.Common reasons you might never see the "away" state:- There is frequent activity (user or agent speaking/thinking), so the timer never reaches the timeout.- The session is rarely or never in the "listening" state for both user and agent at the same time.- user_away_timeout is set to None or the room isn't fully initialized.To test the "away" state, ensure both user and agent are silent and in "listening" state for longer than user_away_timeout (5 seconds in your example). Sources: livekit-agents/livekit/agents/voice/events.py
m
I'm just sitting here for 20 seconds and neither the llm or the user get a status of away. I'm on the latest version of livekit agents
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!
m
this isn't helpful
d
@millions-honey-27871 which version of the library are you using? this is a relatively new feature.
m
Hey David! This turned out to be a me problem. I'm using a custom tts provider so I can run open source voice models and the class was missing a few things needed to make this work. Super stoked to be on livekit btw! We've been building on Pipecat for the past 6 months and made the switch. 🫡
d
@millions-honey-27871 glad you got around it! glad to hear you are building on it? mind if I hit you up for feedback? especially curious on the migration experience and if there's anything we could improve on our end
m
Yeah, would be happy to!