From b00bc449216ff21bea660868fb2b0ed1f4d084d7 Mon Sep 17 00:00:00 2001 From: Brandon Hancock Date: Wed, 24 Jul 2024 11:27:47 -0400 Subject: [PATCH] Add back in commentary at top of pipeline file --- src/crewai/pipeline/pipeline.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/crewai/pipeline/pipeline.py b/src/crewai/pipeline/pipeline.py index 95017f0c7..7dd5f0fa3 100644 --- a/src/crewai/pipeline/pipeline.py +++ b/src/crewai/pipeline/pipeline.py @@ -11,6 +11,38 @@ from crewai.pipeline.pipeline_run_result import PipelineRunResult Trace = Union[Union[str, Dict[str, Any]], List[Union[str, Dict[str, Any]]]] +""" +Pipeline Terminology: +Pipeline: The overall structure that defines a sequence of operations. +Stage: A distinct part of the pipeline, which can be either sequential or parallel. +Run: A specific execution of the pipeline for a given set of inputs, representing a single instance of processing through the pipeline. +Branch: Parallel executions within a stage (e.g., concurrent crew operations). +Trace: The journey of an individual input through the entire pipeline. + +Example pipeline structure: +crew1 >> crew2 >> crew3 + +This represents a pipeline with three sequential stages: +1. crew1 is the first stage, which processes the input and passes its output to crew2. +2. crew2 is the second stage, which takes the output from crew1 as its input, processes it, and passes its output to crew3. +3. crew3 is the final stage, which takes the output from crew2 as its input and produces the final output of the pipeline. + +Each input creates its own run, flowing through all stages of the pipeline. +Multiple runs can be processed concurrently, each following the defined pipeline structure. + +Another example pipeline structure: +crew1 >> [crew2, crew3] >> crew4 + +This represents a pipeline with three stages: +1. A sequential stage (crew1) +2. A parallel stage with two branches (crew2 and crew3 executing concurrently) +3. Another sequential stage (crew4) + +Each input creates its own run, flowing through all stages of the pipeline. +Multiple runs can be processed concurrently, each following the defined pipeline structure. +""" + + class Pipeline(BaseModel): stages: List[Union[Crew, List[Crew]]] = Field( ..., description="List of crews representing stages to be executed in sequence"