diff --git a/src/crewai/task.py b/src/crewai/task.py index 6f17ea033f..1459e8ac68 100644 --- a/src/crewai/task.py +++ b/src/crewai/task.py @@ -201,6 +201,7 @@ def _execute(self, agent, task, context, tools): 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 768504f60d..a410a545b9 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")