File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,14 @@ var (
107107 Name : "grant" ,
108108 Usage : "Additional `VIDEO_GRANT` fields. It'll be merged with other arguments (JSON formatted)" ,
109109 },
110+ & cli.StringFlag {
111+ Name : "agent" ,
112+ Usage : "Agent to dispatch to the room (identified by agent_name)" ,
113+ },
114+ & cli.StringFlag {
115+ Name : "job-metadata" ,
116+ Usage : "Metadata attached to job dispatched to the agent (ctx.job.metadata)" ,
117+ },
110118 },
111119 },
112120 },
@@ -322,6 +330,19 @@ func createToken(ctx context.Context, c *cli.Command) error {
322330
323331 at := accessToken (project .APIKey , project .APISecret , grant , participant )
324332
333+ if grant .RoomJoin {
334+ if agent := c .String ("agent" ); agent != "" {
335+ jobMetadata := c .String ("job-metadata" )
336+ at .SetRoomConfig (& livekit.RoomConfiguration {
337+ Agents : []* livekit.RoomAgentDispatch {
338+ {
339+ AgentName : agent ,
340+ Metadata : jobMetadata ,
341+ },
342+ },
343+ })
344+ }
345+ }
325346 if metadata != "" {
326347 at .SetMetadata (metadata )
327348 }
You can’t perform that action at this time.
0 commit comments