bringing TaskOutput.result back to avoind breakign change

This commit is contained in:
João Moura
2024-02-23 15:23:58 -03:00
parent 464dfc4e67
commit 093a9c8174
3 changed files with 6 additions and 3 deletions

View File

@@ -157,7 +157,7 @@ def callback_function(output: TaskOutput):
print(f""" print(f"""
Task completed! Task completed!
Task: {output.description} Task: {output.description}
Output: {output.result} Output: {output.raw_ouput}
""") """)
research_task = Task( research_task = Task(
@@ -198,7 +198,7 @@ result = crew.kickoff()
print(f""" print(f"""
Task completed! Task completed!
Task: {task1.output.description} Task: {task1.output.description}
Output: {task1.output.result} Output: {task1.output.raw_ouput}
""") """)
``` ```

View File

@@ -18,3 +18,6 @@ class TaskOutput(BaseModel):
excerpt = " ".join(self.description.split(" ")[:10]) excerpt = " ".join(self.description.split(" ")[:10])
self.summary = f"{excerpt}..." self.summary = f"{excerpt}..."
return self return self
def result(self):
return self.exported_output

View File

@@ -237,7 +237,7 @@ class Telemetry:
{ {
"id": str(task.id), "id": str(task.id),
"description": task.description, "description": task.description,
"output": task.output.result, "output": task.output.raw_output,
} }
for task in crew.tasks for task in crew.tasks
] ]