gentle-dream-14103
09/25/2025, 9:32 AMtall-airline-16756
09/25/2025, 9:32 AMtall-airline-16756
09/25/2025, 9:33 AMcli.run_app function works. While it’s not a lifecycle function on its own, it acts as the starting point to activate the agent worker and connect it to the LiveKit server. This function essentially kicks off the agent lifecycle by launching the worker process, which listens for job requests and manages the agent instances.
Some important lifecycle-related functions are set up in WorkerOptions, and they include:
• entrypoint_fnc: This runs the main agent logic whenever a job is assigned.
• request_fnc: This helps decide whether to accept or reject incoming job requests.
• prewarm_fnc: This prepares shared resources ahead of time to boost performance.
• load_fnc and load_threshold: These keep an eye on system load to help control job acceptance.
If you’d like, I’m here to walk you through implementing these functions or configuring the agent lifecycle in more detail. Just let me know how I can assist!
Sources: Anatomy of an Agent | LiveKit Docs | Anatomy of an Agent | LiveKit Docs | Worker options | LiveKit Docs | examples/minimal_worker.py | telephony/sip_lifecycle.py