purple-printer-83527
08/28/2025, 6:14 PMtall-airline-16756
08/28/2025, 6:14 PMtall-airline-16756
08/28/2025, 6:15 PMpurple-printer-83527
08/28/2025, 6:15 PMtall-airline-16756
08/28/2025, 6:15 PMpurple-printer-83527
08/28/2025, 6:15 PMtall-airline-16756
08/28/2025, 6:16 PMAgentSession. Since the AvatarSession depends on the AgentSession, ending the AgentSession will naturally close the AvatarSession too.
Here’s a simple way to do it:
await session.drain() # Make sure any ongoing audio finishes playing
await session.aclose() # Close the agent session, which also ends the avatar session
This way, everything shuts down smoothly. If you have any questions or want me to walk you through it, just let me know—I’m here to help!
Sources: Tavus virtual avatar integration guide | LiveKit Docs | basics/exit_message.py | livekit-plugins/livekit-plugins-tavus/README.md | Bringing AI avatars to voice agents | Job lifecycle | LiveKit Docs