does agentsession have session.aclose() ?
# ask-ai
f
does agentsession have session.aclose() ?
✅ 1
t
Thanks for reaching out, Palwisha. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Yes — AgentSession provides an awaitable
aclose()
method. • Use it as:
await session.aclose()
•
aclose()
performs an immediate, awaitable shutdown and waits for queued operations to finish before closing. • This differs from
shutdown(drain=True)
, which allows graceful draining of pending speech but is non-blocking. Sources: Agent session | LiveKit Documentation | Job lifecycle | LiveKit Documentation, with interactive elements