future-beard-52446
02/15/2025, 8:12 AMgray-monkey-83525
02/15/2025, 8:12 AMVoicePipelineAgent
, you should follow a sequence of steps. First, disconnect from the room using await ctx.room.disconnect()
. Then, close the agent with await agent.aclose()
. Finally, shut down the context with ctx.shutdown()
. This sequence ensures that all resources are properly released and the session is terminated cleanly.
Would you like more detail on any of these steps?
Sources:
- LiveKit Slack Discussion 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.future-beard-52446
02/15/2025, 8:15 AMfuture-beard-52446
02/15/2025, 8:16 AMgray-monkey-83525
02/15/2025, 8:16 AMbefore_llm_cb
callback, you can implement a sequence to disconnect the room, close the agent, and shut down the context. Here's a basic outline:
1. Disconnect from the Room: Use await ctx.room.disconnect()
to ensure the room is properly disconnected.
2. Close the Agent: Call await agent.aclose()
to close the agent and release any resources it holds.
3. Shutdown the Context: Finally, use ctx.shutdown()
to complete the shutdown process.
This approach ensures that all components are properly terminated and resources are freed. Would you like more detailed guidance or a code example?
Sources:
- https://docs.livekit.io/python/livekit/agents/pipeline/index.html#args
- https://docs.livekit.io/python/livekit/agents/pipeline/pipeline_agent.html#args 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.