mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-05-03 16:22:49 +00:00
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:
1
src/crewai/crews/__init__.py
Normal file
1
src/crewai/crews/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from .crew_output import CrewOutput
|
||||
18
src/crewai/crews/crew_output.py
Normal file
18
src/crewai/crews/crew_output.py
Normal 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
|
||||
Reference in New Issue
Block a user