Wake Up Call
Wake Up Call enables AI agents to automatically trigger actions when users remain inactive for a specified duration. This feature helps maintain user engagement and provides proactive assistance during conversation sessions.
Overview
The Wake Up Call system allows AI agents to:
- Monitor user inactivity periods during conversations
- Automatically trigger custom callback functions after specified timeouts
- Re-engage users with proactive messages or actions
Key Components
1. Wake Up Configuration
Set the inactivity timeout duration in the AgentSession
constructor using the wake_up
parameter:
session = AgentSession(
agent=agent,
pipeline=pipeline,
conversation_flow=conversation_flow,
wake_up=10 # seconds
)
Important: If a wake_up
time is provided, you must set a callback function before starting the session. If no wake_up
time is specified, no timer or callback will be activated.
2. Callback Function
Define a custom async function that will be executed when the inactivity threshold is reached:
async def on_wake_up():
print("Wake up triggered - user inactive for 10 seconds")
session.say("Hello, how can I help you today?")
# Assign the callback function to the session
session.on_wake_up = on_wake_up
Get started quickly with the Wake Up Call Example — everything you need to implement inactivity detection in your AI agents.
Got a Question? Ask us on discord