alert-notebook-4408
03/11/2026, 11:15 AMtall-airline-16756
03/11/2026, 11:15 AMtall-airline-16756
03/11/2026, 11:16 AMimport asyncio
# Pause the agent for 2 seconds so the user can speak first
await asyncio.sleep(2)
# then continue with any agent actions (or just let it remain listening)
• If you want the agent to wait for the user to finish speaking and then delay 2 seconds before responding, set the session’s endpointing delay (so it waits after user stops speaking):
session = AgentSession(
stt="your-stt-model",
llm="your-llm-model",
tts="your-tts-model",
vad=your_vad_instance,
min_endpointing_delay=2.0, # waits 2 seconds after user stops speaking
)
A couple of practical tips:
• Don’t call session.generate_reply() or session.say() immediately at startup if you want the agent to listen first.
• If you prefer event-driven control, listen for user state changes (e.g., user_state_changed) and then either await asyncio.sleep(2) before sending a reply or rely on min_endpointing_delay to handle the pause automatically.
If you tell me which language/runtime you’re using (async Python, sync Python, Node.js, etc.) or where in the session flow you want the pause (at startup, after user stops speaking, or before a specific prompt), I can give a short, tailored code snippet.
Sources: VAD and turn detection configuration guide | LiveKit | Agents Framework | livekit/livekit_composite | DeepWiki | Agent session | LiveKit Documentation