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 per WorkerRunner before its spawned workers start.

  • setup_pipeline_worker(worker) — invoked once per PipelineWorker while the worker sets up its pipeline. The legacy name setup_pipeline_task is still recognized but emits a DeprecationWarning; rename it to setup_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 every PIPECAT_SETUP_FILES module.

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_name is not defined. When invoked, a DeprecationWarning is emitted telling the user to rename.