ai_graph.step.base module

Base classes for pipeline steps.

class ai_graph.step.base.BasePipelineStep(name=None)[source]

Bases: ABC

Abstract base class for pipeline steps in a Chain of Responsibility pattern.

Each pipeline step can process input data and pass it to the next step.

__init__(name=None)[source]

Initialize a pipeline step.

Parameters:

name (str, optional) – A descriptive name for this pipeline step.

set_next(step)[source]

Set the next step in the pipeline chain.

Parameters:

step (BasePipelineStep) – The next step in the pipeline.

Return type:

BasePipelineStep

Returns:

The next step for chaining purposes.

process(data)[source]

Process the input data and pass to the next step if available.

Parameters:

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

Return type:

Dict[str, Any]

Returns:

Processed data.