(ads []*agentDispatch, p types.Participant, jobType livekit.JobType)
| 1793 | } |
| 1794 | |
| 1795 | func (r *Room) launchTargetAgents(ads []*agentDispatch, p types.Participant, jobType livekit.JobType) { |
| 1796 | if p == nil || p.IsDependent() || r.agentClient == nil { |
| 1797 | return |
| 1798 | } |
| 1799 | |
| 1800 | for _, ad := range ads { |
| 1801 | done := ad.jobsLaunching() |
| 1802 | |
| 1803 | go func() { |
| 1804 | inc := r.agentClient.LaunchJob(context.Background(), &agent.JobRequest{ |
| 1805 | JobType: jobType, |
| 1806 | Room: r.ToProto(), |
| 1807 | Participant: p.ToProto(), |
| 1808 | Metadata: ad.Metadata, |
| 1809 | AgentName: ad.AgentName, |
| 1810 | DispatchId: ad.Id, |
| 1811 | Deployment: ad.Deployment, |
| 1812 | Attributes: ad.Attributes, |
| 1813 | }) |
| 1814 | r.handleNewJobs(ad.AgentDispatch, inc) |
| 1815 | done() |
| 1816 | }() |
| 1817 | } |
| 1818 | } |
| 1819 | |
| 1820 | func (r *Room) handleNewJobs(ad *livekit.AgentDispatch, inc *sutils.IncrementalDispatcher[*livekit.Job]) { |
| 1821 | inc.ForEach(func(job *livekit.Job) { |
no test coverage detected