Worker options
Path to a file that has Agent as a default export, dynamically imported later for entrypoint and prewarm functions
Optional agentSet agentName to enable explicit dispatch. When explicit dispatch is enabled, jobs will not be dispatched to rooms automatically. Instead, you can either specify the agent(s) to be dispatched in the end-user's token, or use the AgentDispatch.createDispatch API.
By default it uses LIVEKIT_AGENT_NAME from environment.
Optional agentInternal flag indicating that agentName was resolved from LIVEKIT_AGENT_NAME. Forwarded
through ServerOptions re-construction (e.g. cli.ts spread) so the env-source signal isn't
lost.
Optional apiOptional apiOptional host?: stringOptional initializeOptional jobOptional jobOptional loadCalled to determine the current load of the worker. Should return a value between 0 and 1.
Optional loadWhen the load exceeds this threshold, the worker will be marked as unavailable.
Optional logOptional maxOptional numOptional permissions?: WorkerPermissionsOptional port?: numberOptional production?: booleanOptional requestOptional serverOptional shutdownOptional workerOptional wsURL?: stringOptional apiOptional apiOptional worker
Data class describing worker behaviour.
Remarks
The Agents framework provides sane worker defaults, and works out-of-the-box with no tweaking necessary. The only mandatory parameter is
agent, which points to the entry function.This class is mostly useful in conjunction with cli.runApp.