Adds Task key to the output to back ref to it on callbacks/webhooks

This commit is contained in:
Thiago Moretto
2025-02-27 16:31:25 -03:00
parent 86825e1769
commit 861560aa93
3 changed files with 4 additions and 0 deletions

View File

@@ -373,6 +373,7 @@ class Task(BaseModel):
pydantic_output, json_output = self._export_output(result)
task_output = TaskOutput(
key=self.key,
name=self.name,
description=self.description,
expected_output=self.expected_output,

View File

@@ -9,6 +9,7 @@ from crewai.tasks.output_format import OutputFormat
class TaskOutput(BaseModel):
"""Class that represents the result of a task."""
key: Optional[str] = Field(description="Key of the task", default=None)
description: str = Field(description="Description of the task")
name: Optional[str] = Field(description="Name of the task", default=None)
expected_output: Optional[str] = Field(