agents icon indicating copy to clipboard operation
agents copied to clipboard

Joining all existing rooms

Open leejiliang opened this issue 1 year ago • 5 comments

When I started the Agent Worker, the current situation will only be added to the room created after that. I have a lot of already active rooms. I have no other way to trigger the addition of Agent except for re -creation. The only thing I can refer to the document can refer to : Python my_Agent.py Connect-ROOM <MY-Room>, but this operation can only be processed before I start agent and can only handle one room. Did I miss what I read the document? Thank you for answering.

agent 0.8.0. example : simple-color livekit: 1.6.2

leejiliang avatar Jul 25 '24 07:07 leejiliang

If your purpose for having a lot of rooms is for prewarming/setup - we've introduced a prewam_fnc in the WorkerOptions

If your issue is that agents are leaving the room and you have no way of adding them back, you can use our livekit-api package to delete the room upon agent disconnection. After doing this, re-joining the same "room" name will trigger an agent rejoin. You can also set departureTimeout and emptyTimeout on your rooms to reduce these situations

keepingitneil avatar Jul 25 '24 19:07 keepingitneil

My situation is more like the second situation described, but I can't turn off a room in an active state. I hope that after I start a worker process, I can traverse the existing rooms, and then join an agent as the participant, I read the code of the livekit server. When the room was created, I started a goroutine to process the LaunchJob function. I did not find a similar function in SDK-GO. Does the official provide this API in the Client SDK or Server SDK?

leejiliang avatar Aug 01 '24 07:08 leejiliang

Finally, by modifying the source code of the service side, through the expansion of RoomService.UpdateroommetAdata, it triggers the agent to add the room by updating the metadata of the room. But my logic is achieved through hard coding.

leejiliang avatar Aug 02 '24 06:08 leejiliang

livekit 1.7.2 has support it , https://github.com/livekit/livekit/pull/2919.

leejiliang avatar Aug 14 '24 06:08 leejiliang

yes, in a future, you'll be able to create manual dispatches for agents.

davidzhao avatar Aug 24 '24 00:08 davidzhao