Avoid empty task outputs

This commit is contained in:
João Moura
2024-02-24 03:11:41 -03:00
parent 7f98a99e90
commit ab98c3bd28
2 changed files with 3 additions and 2 deletions

View File

@@ -254,7 +254,7 @@ class Crew(BaseModel):
if self.full_output:
return {
"final_output": output,
"tasks_outputs": [task.output for task in self.tasks],
"tasks_outputs": [task.output for task in self.tasks if task],
}
else:
return output

View File

@@ -116,7 +116,8 @@ class Task(BaseModel):
for task in self.context:
if task.async_execution:
task.thread.join()
context.append(task.output.raw_output)
if task and task.output:
context.append(task.output.raw_output)
context = "\n".join(context)
tools = tools or self.tools