fix: agent missing fix (#966)

This commit is contained in:
Eduardo Chiarotti
2024-07-19 13:15:33 -03:00
committed by GitHub
parent fcc57f2fc0
commit f9288295e6

View File

@@ -213,8 +213,8 @@ class Task(BaseModel):
tools: Optional[List[Any]], tools: Optional[List[Any]],
) -> TaskOutput: ) -> TaskOutput:
"""Run the core execution logic of the task.""" """Run the core execution logic of the task."""
self.agent = agent
agent = agent or self.agent agent = agent or self.agent
self.agent = agent
if not agent: if not agent:
raise Exception( raise Exception(
f"The task '{self.description}' has no agent assigned, therefore it can't be executed directly and should be executed in a Crew using a specific process that support that, like hierarchical." f"The task '{self.description}' has no agent assigned, therefore it can't be executed directly and should be executed in a Crew using a specific process that support that, like hierarchical."