ai_graph.pipeline.base module

The base module for the AI Graph pipeline.

This module provides the core infrastructure for creating processing pipelines for phase detection in eye surgeries.

class ai_graph.pipeline.base.Pipeline(name, first_step=None)[source]

Bases: object

Class that manages the pipeline of processing steps.

__init__(name, first_step=None)[source]

Initialize the pipeline.

Parameters:

first_step (BasePipelineStep, optional) – The first step of the pipeline.

add_step(step)[source]

Add a step to the pipeline.

Parameters:

step (BasePipelineStep) – The step to add.

Return type:

Pipeline

Returns:

The pipeline instance for chaining.

process(data)[source]

Process the input through the entire pipeline.

Parameters:

data (Dict[str, Any]) – Input data to be processed.

Return type:

Dict[str, Any]

Returns:

The fully processed data.

Raises:

ValueError – If the pipeline has no steps.