busy-breakfast-32623
10/06/2025, 11:22 AMtall-airline-16756
10/06/2025, 11:22 AMtall-airline-16756
10/06/2025, 11:22 AMbusy-breakfast-32623
10/06/2025, 11:23 AMtall-airline-16756
10/06/2025, 11:23 AMagent_name in Worker Options: When you initialize your agent worker, make sure to specify the agent_name in the WorkerOptions. This step is key because it enables explicit dispatch and turns off automatic dispatch. Here’s how you can do it:
# Python Example
from livekit.agents import WorkerOptions
options = WorkerOptions(
worker_name="my-custom-agent", # Optional identifier
agent_name="sales-support-bot" # Custom name for dispatch
)
// Node.js Example
const options = {
workerName: "my-custom-agent",
agentName: "sales-support-bot"
};
1. Deploy the Agent Using LiveKit CLI: Next, you’ll want to deploy your agent to LiveKit Cloud using the lk agent deploy command. Just a heads-up, the CLI doesn’t let you specify a custom agent name during deployment directly.
lk agent deploy [working-dir]
1. Dispatch the Agent by Name: After your agent is deployed, you can dispatch it using the AgentDispatchService with the agent_name you set earlier. Here’s how you can do this:
# Python Example
from livekit.agents import dispatch_agent
await dispatch_agent(
room=room,
participant=participant,
agent_name="sales-support-bot",
metadata={"user_id": "12345"}
)
// Node.js Example
await dispatchAgent({
room,
participant,
agentName: "sales-support-bot",
metadata: { user_id: "12345" }
});
This method gives you full control over when and how your named agent is called. If you have any questions or need a hand with any of these steps, feel free to reach out—I’m here to help!
Sources: Agent dispatch | LiveKit Docs | Deploying to production | LiveKit Docs | protobufs/livekit_cloud_agent.proto | Agents telephony integration | LiveKit Docs