Add name and expected_output to TaskOutput (#1199)

* Add name and expected_output to TaskOutput

This commit adds task information to the TaskOutput class. This is
useful to provide extra context to callbacks.

* Populate task name from function names

This commit populates task name from function names when using
annotations.
This commit is contained in:
Vini Brasil
2024-08-15 22:24:41 +01:00
committed by GitHub
parent d0707fac91
commit dbf2570353
5 changed files with 43 additions and 2 deletions

View File

@@ -240,7 +240,9 @@ class Task(BaseModel):
pydantic_output, json_output = self._export_output(result)
task_output = TaskOutput(
name=self.name,
description=self.description,
expected_output=self.expected_output,
raw=result,
pydantic=pydantic_output,
json_dict=json_output,