big-controller-60015
05/08/2025, 9:37 AMtall-airline-16756
05/08/2025, 9:37 AMtall-airline-16756
05/08/2025, 9:38 AMreject()
method of the JobRequest
class within your request handler function. Here's an example:
async def request_fnc(req: JobRequest):
# Reject the job request
await req.reject()
This function is executed each time the server has a job for the agent. By calling req.reject()
, you explicitly tell the framework to reject the job request, which will then be sent to the next available worker.
Include this request handler when setting up your worker options:
opts = WorkerOptions(
entrypoint_fnc=entrypoint,
request_fnc=request_fnc,
# other options...
)
If you don't provide a request handler, the default behavior is to auto-accept all requests dispatched to the worker.
Sources: Anatomy of an Agent | LiveKit Docsbig-controller-60015
05/08/2025, 9:41 AMtall-airline-16756
05/08/2025, 9:41 AMbig-controller-60015
05/08/2025, 9:48 AM