The Pipeline
framework in MiniAutoGen is a flexible and modular system designed for data processing, particularly in chat applications. It allows for the sequential processing of data through a series of components, each handling specific tasks or transformations.
Represents a data processing pipeline, which is a sequence of PipelineComponent
objects.
components
(list ofPipelineComponent
): The list of components in the pipeline.
- Purpose: Initializes the pipeline with a list of components.
- Parameters:
components
(list ofPipelineComponent
, optional): The components to be included in the pipeline. Defaults to an empty list if not provided.
- Purpose: Adds a new component to the pipeline.
- Parameters:
component
(PipelineComponent
): The component to be added.
- Exceptions: Raises
TypeError
if the component is not a subclass ofPipelineComponent
.
- Purpose: Executes the pipeline on the given state, passing the state through each component in sequence.
- Parameters:
state
(ChatPipelineState
): The current state of the chat to be processed.
- Returns: The modified
ChatPipelineState
after processing through all components.
my_pipeline = Pipeline(components=[component1, component2])
my_pipeline.add_component(new_component)