acceptable-dream-85180
08/26/2025, 9:39 PMlivekit_api.AccessToken(config.livekit_api_key, config.livekit_api_secret)
.with_identity(candidate_id)
.with_ttl(timedelta(minutes=15))
.with_grants(livekit_api.VideoGrants(room_join=True, room=room_name, can_publish=True, can_subscribe=True))
.with_room_config(livekit_api.RoomConfiguration(agents=[livekit_api.RoomAgentDispatch(agent_name='CA_qG9BhWGxdBGw')]))
.to_jwt()tall-airline-16756
08/26/2025, 9:39 PMtall-airline-16756
08/26/2025, 9:39 PMacceptable-dream-85180
08/26/2025, 9:41 PMtall-airline-16756
08/26/2025, 9:41 PMagent_name field when you're configuring WorkerOptions in your agent's code. This is super important for explicit agent dispatch, which basically helps you control how agents get assigned to rooms.
Here’s how you can find or set the agent name:
1. In your agent implementation, just set the agent_name parameter inside WorkerOptions. For example:
# Python example
opts = WorkerOptions(
agent_name="test-agent",
)
// Node.js example
const opts = new WorkerOptions({
agentName: "test-agent",
});
1. Make sure the agent name matches both in your agent code and in any dispatch rules you set up, like in RoomAgentDispatch or the access token.
If you get stuck or want a hand with setting or finding the agent name, just give me a shout—I’m here to help!
Sources: Agent dispatch | LiveKit Docs | SIP troubleshooting guide | LiveKit Docs | JobRequest | LiveKit Agents | templates.yaml | Dispatching agents | LiveKit Docsacceptable-dream-85180
08/26/2025, 9:56 PMtall-airline-16756
08/26/2025, 9:56 PMagent_name is set inside `WorkerOptions`:
if __name__ == "__main__":
cli.run_app(
WorkerOptions(
entrypoint_fnc=entrypoint,
agent_name="my-telephony-agent" # This enables explicit dispatch
)
)
A few things to keep in mind:
• Setting agent_name turns off automatic dispatch and lets you control dispatch explicitly through the API or room settings.
• Make sure the agent_name matches the name you use in your dispatch rules or access tokens.
• This is super handy for telephony integrations, helping to prevent any unexpected agent behavior.
If you’d like a hand with this or want to see more examples, just give me a shout!
Sources: evaluating-agents/agent_evals.py | Making calls using SIP | LiveKit Docs | Dispatching agents | LiveKit Docs | examples/agent_dispatch.py | Agent dispatch | LiveKit Docs