fastrag.ingestion.pipeline#
Pipeline: the context manager that evaluates a lazy step graph.
Constructing a Pipeline never evaluates anything — it only records
the root step and the pipeline-level defaults (cache/policy) a step
falls back to when it declares none of its own. Entering it (async with)
installs an event sink (via
fastrag.ingestion.steps.base.event_sink_scope()) so that any step
evaluated during the block — not just the ones this Pipeline drives
itself — has its events routed here. __aiter__/run() drive the root
step’s evaluation under one
ExecutionContext built from this
pipeline’s own cache/policy, concurrently draining the events it
produces through a queue.
Classes
|
Evaluates a lazy |
- class fastrag.ingestion.pipeline.Pipeline(root, *, cache=None, policy=None, source_headers_only=False, headers_only=False)[source]#
Bases:
AbstractAsyncContextManager[Pipeline]Evaluates a lazy
PipelineStepgraph.Pipelineowns theExecutionContextfor a whole run: it is responsible for creating it (with this pipeline’s own defaultcache/policy) and for installing the event sink every step in the graph — however deeply nested — ultimately emits into.async with Pipeline(vector_store.save(embedded_documents)) as pipeline: await ConsoleLogger(pipeline).run()
- Parameters:
root (PipelineStep[Any])
cache (CacheStore | None)
policy (Policy | None)
source_headers_only (bool)
headers_only (bool)
- property root: PipelineStep[Any]#
The step this pipeline evaluates — and the top of its upstream chain.