How do I change the Agent name of agents deployed ...
# ask-ai
i
How do I change the Agent name of agents deployed to LiveKit Cloud
t
Thanks for reaching out, Kuangji. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I understand that you’re looking to change the agent name of an agent already deployed to LiveKit Cloud. Currently, the agent name can only be set when you first create the agent using the
agent_name
field in the
CreateAgentRequest
. If you’d like to have a different agent name, the best way forward would be to create a new agent with the name you want. I’m here to help if you need any guidance with that! Sources: livekit/livekit_cloud_agent.twirp.go | cmd/lk/agent.go
i
I'm using cli to create agent. can you walk me through how to create a new agent using the agent_name field?
t
I'd be happy to guide you through creating a new agent with a specific
agent_name
using the LiveKit CLI. Here's a simple step-by-step approach to help you out: 1. Generate an agent template:
lk app create --template voice-pipeline-agent-python
2. Modify the agent code: Open the
agent.py
file and set the
agent_name
in the
WorkerOptions
like this:
Copy code
if __name__ == "__main__":
    cli.run_app(
        WorkerOptions(
            entrypoint_fnc=entrypoint,
            prewarm_fnc=prewarm,
            agent_name="your-agent-name",
        ),
    )
3. Create and deploy the agent:
lk agent create
4. Optionally dispatch the agent: When you're ready, you can dispatch the agent explicitly using the CLI:
lk dispatch create --new-room --agent-name your-agent-name --metadata 'custom metadata'
By setting the
agent_name
directly in your code, your agent will register with that name, making it easy to target for dispatching. If you have any questions or need a hand with any of these steps, please don't hesitate to ask—I'm here to help!
i
this is my code but when I deployed the agent, the agent name on livekit cloud was empty 'if name == "__main__": cli.run_app(WorkerOptions( entrypoint_fnc=entrypoint, agent_name="triage-agent" ))"
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!