mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-28 09:38:17 +00:00
Add back in commentary at top of pipeline file
This commit is contained in:
@@ -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]]]]
|
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):
|
class Pipeline(BaseModel):
|
||||||
stages: List[Union[Crew, List[Crew]]] = Field(
|
stages: List[Union[Crew, List[Crew]]] = Field(
|
||||||
..., description="List of crews representing stages to be executed in sequence"
|
..., description="List of crews representing stages to be executed in sequence"
|
||||||
|
|||||||
Reference in New Issue
Block a user