Working on creating Crew templates and pipeline templates

This commit is contained in:
Brandon Hancock
2024-08-01 11:43:39 -04:00
parent c5e8302a7d
commit 9996cf206e
29 changed files with 502 additions and 66 deletions

View File

@@ -0,0 +1,26 @@
from crewai import Pipeline
from crewai.project import PipelineBase
from crews.crew import *
@PipelineBase
class {{pipeline_name}}Pipeline:
def __init__(self):
# Initialize crews
{% for crew_name in crew_names %}
self.{{crew_name.lower()}}_crew = {{crew_name}}Crew().crew()
{% endfor %}
@pipeline
def create_pipeline(self):
return Pipeline(
stages=[
{% for crew_name in crew_names %}
self.{{crew_name.lower()}}_crew,
{% endfor %}
]
)
async def run(self, inputs):
pipeline = self.create_pipeline()
results = await pipeline.kickoff(inputs)
return results