Cleaned up task execution to now have separate paths for async and sync execution. Updating all kickoff functions to return CrewOutput. WIP. Waiting for Joao feedback on async task execution with task_output

This commit is contained in:
Brandon Hancock
2024-06-20 12:11:27 -04:00
parent 377f919d42
commit ea5a784877
7 changed files with 10351 additions and 220 deletions

View File

@@ -0,0 +1 @@
from .crew_output import CrewOutput

View File

@@ -0,0 +1,18 @@
from typing import Any, Dict, Union
from pydantic import BaseModel, Field
from crewai.tasks.task_output import TaskOutput
class CrewOutput(BaseModel):
final_output: str = Field(description="Final output of the crew")
tasks_output: list[TaskOutput] = Field(
description="Output of each task", default=[]
)
token_output: Dict[str, Any] = Field(
description="Processed token summary", default={}
)
def __str__(self):
return self.final_output