AI Agents
The agents resource dispatches deployed agents into rooms (optionally placing an outbound call) and manages cloud deployments.
Dispatch an agent
- Node.js
- Go
const dispatch = await client.agents.dispatch({
agentId: "agent_123",
roomId: "abcd-efgh-ijkl", // or meetingId
roomOptions: { joinMeeting: true, vision: true },
});
dispatch.jobId;
dispatch.status;
dispatch, err := client.Agents.Dispatch(ctx, videosdk.DispatchAgentParams{
AgentID: "agent_123",
RoomID: "abcd-efgh-ijkl", // or MeetingID
RoomOptions: &videosdk.AgentRoomOptions{JoinMeeting: videosdk.Bool(true), Vision: videosdk.Bool(true)},
})
fmt.Println(dispatch.JobID, dispatch.Status)
Options: agentId (required), roomId / meetingId (one required), roomOptions, sipOptions (when present, the dispatch also places an outbound call), metadata, versionId, versionTag.
connect is an alias of dispatch. generalDispatch dispatches a managed/low-code agent and requires versionId.
Deploy a pre-built image
One call creates the deployment, its version (auto-activated), and, when env vars are set, a secret to hold them.
- Node.js
- Go
const deployment = await client.agents.deploy({
name: "voice-assistant",
image: "registry.videosdk.live/acme/agent:1.4",
env: { OPENAI_API_KEY: "sk-..." },
scaling: { min: 1, max: 20 },
});
deployment.id;
deployment, err := client.Agents.Deploy(ctx, videosdk.DeployAgentParams{
Name: "voice-assistant",
Image: "registry.videosdk.live/acme/agent:1.4",
Env: map[string]string{"OPENAI_API_KEY": "sk-..."},
Scaling: &videosdk.AgentScaling{Min: videosdk.Int(1), Max: videosdk.Int(20)},
})
fmt.Println(deployment.ID)
Options: name and image (required), env, scaling (max ≤ 50), profile (cpu-small, cpu-medium, cpu-large), region, agentId, versionTag, webhook.
Manage deployments
- Node.js
- Go
await client.agents.listDeployments({ agentId: "agent_123" });
await client.agents.getDeployment("dep_1");
await client.agents.getLatestVersion("dep_1");
await client.agents.deleteDeployment("dep_1", { force: true });
await client.agents.setVersionActive(versionId, true); // false stops the version
client.Agents.ListDeployments(ctx, videosdk.ListDeploymentsParams{AgentID: videosdk.String("agent_123")})
client.Agents.GetDeployment(ctx, "dep_1")
client.Agents.GetLatestVersion(ctx, "dep_1")
client.Agents.DeleteDeployment(ctx, "dep_1", true) // force
client.Agents.SetVersionActive(ctx, versionID, true, false) // activate, force
Logs
Historical console logs (default: the last 24 hours).
- Node.js
- Go
for await (const line of await client.agents.logs("dep_1", { roomId })) {
console.log(line.log);
}
logs, err := client.Agents.Logs(ctx, "dep_1", videosdk.ListDeploymentLogsParams{RoomID: videosdk.String(roomID)})
for _, entry := range logs.Data {
fmt.Println(entry.Log)
}
Got a Question? Ask us on discord

