Closed martinnedenn closed 2 hours ago
We've had a similar use case. We are using room metadata to identify and control which agents can join specific rooms. Each worker checks the room's metadata and then accepts or rejects joining the room based on this information.
Our use case is different This way work for you. Checkout Namepsace, i've no idea how to use them.
This way, you can specify different rooms for Agent A and Agent B without them automatically connecting to all available rooms.
Hello,
Thank you for sharing your approach. How can we implement a system to selectively accept or reject agents joining specific rooms?
Checkout this for creating room with MetaData: https://github.com/livekit/agents/issues/774
Room Metadata: You can use the room metadata to determine whether a worker should join or reject a job. This can be particularly useful when certain conditions (like model, permissions, or other criteria) are required for the worker to proceed.
Custom Request Function (req_func): You can pass a custom req_func to the worker and use this along with room metadata to make the decision on whether the worker should join the room or not. This gives more flexibility in controlling the worker's behavior based on specific room metadata.
https://github.com/livekit/agents/blob/main/livekit-agents/livekit/agents/worker.py#L134
https://github.com/livekit/agents/blob/main/livekit-agents/livekit/agents/job.py#L275
Thank you for help 👌
Hello,
I'm using LiveKit Agents to enable real-time conversation experiences. I’ve successfully deployed a worker for Agent A with its specific settings, and it connects to the room I created in LiveKit Cloud without any issues.
Now, I want to deploy a different worker for Agent B, which has different settings (such as voice and language model). However, when I deploy the worker for Agent B, it also joins the same room as Agent A, instead of being limited to a specific room.
Issue: I need to configure each worker or agent to join only the rooms I specify, rather than automatically connecting to all available rooms. ?