From a3363818498893012be970164a119068b723a402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moura?= Date: Thu, 16 May 2024 05:12:32 -0300 Subject: [PATCH] adding agent to task output --- src/crewai/task.py | 1 + src/crewai/tasks/task_output.py | 1 + 2 files changed, 2 insertions(+) diff --git a/src/crewai/task.py b/src/crewai/task.py index 6f17ea033..1459e8ac6 100644 --- a/src/crewai/task.py +++ b/src/crewai/task.py @@ -201,6 +201,7 @@ class Task(BaseModel): description=self.description, exported_output=exported_output, raw_output=result, + agent=agent.role, ) if self.callback: diff --git a/src/crewai/tasks/task_output.py b/src/crewai/tasks/task_output.py index 768504f60..a410a545b 100644 --- a/src/crewai/tasks/task_output.py +++ b/src/crewai/tasks/task_output.py @@ -11,6 +11,7 @@ class TaskOutput(BaseModel): exported_output: Union[str, BaseModel] = Field( description="Output of the task", default=None ) + agent: str = Field(description="Agent that executed the task") raw_output: str = Field(description="Result of the task") @model_validator(mode="after")