crooked-dawn-90821
09/24/2025, 5:14 PMtall-airline-16756
09/24/2025, 5:14 PMtall-airline-16756
09/24/2025, 5:15 PMAgentSession isn’t directly accessible from the Room or JobContext. Instead, it’s a separate object that you create and manage within your application logic. You connect it to the Room by passing the Room instance to the session’s start() method.
To work with the AgentSession, it’s best to store it in a variable within your code, usually in the entrypoint function. This way, you can easily manage its lifecycle and interact with it whenever needed. If you want to share the session with other parts of your app, you can simply pass the stored session variable to those components.
Please feel free to reach out if you’d like me to walk you through some examples or clarify anything further—I’m here to help!
Sources: complex-agents/role-playing/agent.py | Text and transcriptions | LiveKit Docs | livekit-plugins/livekit-plugins-simli/livekit/plugins/simli/avatar.py