how can I trigger entrypoint from outside the app?
# ask-ai
r
how can I trigger entrypoint from outside the app?
t
Thanks for reaching out, Shahaf. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
To trigger an entrypoint function from outside the application in LiveKit, you can use the AgentDispatchService and set the
agent_name
in the WorkerOptions. This allows you to dispatch the agent via an API call. Here’s how to configure it: 1. Assign a unique name to your agent using the
agent_name
parameter in the WorkerOptions. 2. Use the AgentDispatchService to create a dispatch for your agent. If you need further assistance with setting up the dispatch service or exploring alternative methods, let me know! Sources: Company directory phone assistant | LiveKit Docs | Worker options | LiveKit Docs
r
will it trigger entrypoint? or do something else?
t
When you use the AgentDispatchService, it makes the assigned agent join the room you specify, which then triggers the agent's entrypoint. This is all part of setting up an explicit dispatch, as long as the agent is properly set up with an
agent_name
and the right permissions. If you want a hand with the setup or have any questions, just give me a shout—I’m here to help! Sources: pkg/service/agent_dispatch_service.go | src/main/kotlin/io/livekit/server/AgentDispatchServiceClient.kt | packages/livekit-server-sdk/src/AgentDispatchClient.ts | livekit-api/livekit/api/agent_dispatch_service.py | Dispatching agents | LiveKit Docs
r
no no I have a complicated setup. I just need to add a job for a specific room. I did it with request.post to localhost:port/jobs and it worked. but It doesn't work in render
t
Could you share a bit more about how your setup looks in Render? For example: • Are you using the same configuration (like API keys, ports) as you do locally? • What kind of error or unexpected behavior are you seeing when it doesn’t work on Render? • Are there any network restrictions or differences in how the service is hosted on Render compared to your local setup? Knowing these details will really help me understand what’s going on and figure out the best way to help you out. Sources: Dispatching agents | LiveKit Docs | Dispatching agents | LiveKit Docs
r
the render service returns 405, the render service/jobs returns 404
t
Hey there! Just to clarify, a 405 error usually means the HTTP method (like POST) isn’t allowed for that endpoint, while a 404 means the endpoint itself can’t be found. To get to the bottom of this, could you please check: • Are you sure you’re using the right URL and HTTP method for the Render service? • Is the
/jobs
endpoint set up correctly and accessible in your Render deployment? • Do the API routes or configurations differ between your local setup and Render? Once we have these details, we’ll be in a better spot to figure out what’s going on and help you fix it.
r
I'm not sure, my docker exposes port 8081, I use the service url provided by render. I didn't add a jobs endpoint since it worked locally. the routs are the same.
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!