AI Agents
The agents resource dispatches deployed agents into rooms (optionally placing an outbound call), and manages cloud deployments under agents.deployment.
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 runs the whole pipeline: it 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.Deployment.Create(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 (or imageConfig) (required), env, scaling (max ≤ 50), profile (cpu-small, cpu-medium, cpu-large), region, agentId, versionTag, webhook.
Manage deployments
- Node.js
- Go
await client.agents.deployment.list({ agentId: "agent_123" });
await client.agents.deployment.get("dep_1");
await client.agents.deployment.getLatestVersion("dep_1");
await client.agents.deployment.delete("dep_1", { force: true });
await client.agents.deployment.setVersionActive(versionId, true); // false stops the version
client.Agents.Deployment.List(ctx, videosdk.ListDeploymentsParams{AgentID: videosdk.String("agent_123")})
client.Agents.Deployment.Get(ctx, "dep_1")
client.Agents.Deployment.GetLatestVersion(ctx, "dep_1")
client.Agents.Deployment.Delete(ctx, "dep_1", true) // force
client.Agents.Deployment.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.deployment.logs("dep_1", { roomId })) {
console.log(line.log);
}
logs, err := client.Agents.Deployment.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

