startup
Shared loader for PIPECAT_SETUP_FILES hooks.
Each file listed in the PIPECAT_SETUP_FILES environment variable (colon
separated) may define one or both of the following async functions:
setup_worker_runner(runner)— invoked once perWorkerRunnerbefore its spawned workers start.setup_pipeline_worker(worker)— invoked once perPipelineWorkerwhile the worker sets up its pipeline. The legacy namesetup_pipeline_taskis still recognized but emits aDeprecationWarning; rename it tosetup_pipeline_worker.
Setup files are imported at most once per process; module-level state (for example, a shared debugger instance referenced by both hooks) is preserved across hook invocations.
- async pipecat.utils.startup.run_setup_hook(*, target: Any, function_name: str, deprecated_function_name: str | None = None) None[source]
Run
function_name(target)from everyPIPECAT_SETUP_FILESmodule.- Parameters:
target – Object passed to the hook function.
function_name – Name of the async function to call in each setup file.
deprecated_function_name – Optional legacy name to fall back to when
function_nameis not defined. When invoked, aDeprecationWarningis emitted telling the user to rename.