Hey bot, how can I add the agents name is it throu...
# ask-ai
r
Hey bot, how can I add the agents name is it through the livekit.toml?
t
Thanks for reaching out, Rich. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey there! To add an agent's name in LiveKit, you’ve got a couple of options depending on what works best for you: • Setting Agent Name in Code: You can use the
agent_name
parameter in your agent code when working with
WorkerOptions
. This is super handy for explicit dispatch and telephony setups. Here’s a quick example:
Copy code
if __name__ == "__main__":
    agents.cli.run_app(agents.WorkerOptions(
        entrypoint_fnc=entrypoint,
        # agent_name is required for explicit dispatch
        agent_name="my-telephony-agent"
    ))
• Configuring livekit.toml: Just a heads-up—the
livekit.toml
file uses an
id
field under the
[agent]
section for deployment, not
agent_name
. Here’s how that looks:
Copy code
[project]
subdomain = "<my-project-subdomain>"

[agent]
id = "<agent-id>"
For explicit dispatch, I’d recommend setting
agent_name
right in your code. If you have any questions or want me to walk you through it, just let me know—I’m here to help! Sources: livekit/livekit_cloud_agent.pb.go | Agents telephony integration | LiveKit Docs | examples/agent_dispatch.py | Deploying to production | LiveKit Docs | pkg/config/livekit.go
r
🫡
t
I'm really happy I could help! If anything else pops up or you just want to chat, don't hesitate to reach out. 😊
r
lk agent status show that the agent is sleeping. I have tried calling a few times to wake it however its not responding? I have redeployed and lk agent logs gives me: Agent is sleeping due to inactivity - create a new session to wake it up and view logs
t
Hey, could you help me understand if the agent's "sleeping" status is because of deployment-level inactivity (like scaled down instances) or if it’s happening during a conversation due to session-level inactivity? That way, I can give you the best troubleshooting advice tailored to your situation. Sources: examples/voice_agents/resume_interrupted_agent.py | agent_extensions/agent_extensions/handlers/wake_word_handler.py | Deploying to production | LiveKit Docs | Agent deployment CLI reference | LiveKit Docs