Instantiate default agent dispatches in rtc for better backward compatibility (#2886)

This commit is contained in:
Benjamin Pracht
2024-07-22 08:44:13 -07:00
committed by GitHub
parent bd616d6074
commit 0fd09d73c1
3 changed files with 22 additions and 10 deletions
+9 -1
View File
@@ -1488,7 +1488,15 @@ func (r *Room) createAgentDispatchesFromRoomAgent() {
return
}
for _, ag := range r.internal.AgentDispatches {
roomDisp := r.internal.AgentDispatches
if len(roomDisp) == 0 {
// Backward compatibility: by default, start any agent in the empty JobName
roomDisp = []*livekit.RoomAgentDispatch{
&livekit.RoomAgentDispatch{},
}
}
for _, ag := range roomDisp {
ad := &livekit.AgentDispatch{
Id: guid.New(guid.AgentDispatchPrefix),
AgentName: ag.AgentName,