how do I provide agent name to enable explicit dis...
# ask-ai
a
how do I provide agent name to enable explicit dispatch?
t
Thanks for reaching out, Shajahan. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You're asking how to provide an agent name so the agent is only dispatched explicitly. Here's how to do that and how to dispatch afterwards. Python • Add
agent_name
to the
@server.rtc_session
decorator:
Copy code
@server.rtc_session(agent_name="my-telephony-agent")
async def my_agent(ctx: JobContext):
    # agent logic
Node.js • Set
agentName
in `WorkerOptions`:
Copy code
const opts = new WorkerOptions({
  agentName: "test-agent",
});
After setting the agent name, automatic dispatch is disabled. To dispatch the agent explicitly, use one of these methods: • SIP dispatch rules via
room_config.agents
• Access tokens containing a
RoomConfiguration
with
RoomAgentDispatch
• API calls to
AgentDispatchService
Make sure the agent name matches exactly between the agent definition and whatever dispatch configuration you use. Would you like an example of dispatch via access token, SIP rule, or the API? Sources: Agents telephony integration | LiveKit docs | Agent dispatch | LiveKit docs | server-sdk-js | livekit/livekit_composite | DeepWiki | SIP troubleshooting guide | LiveKit docs