mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 00:28:31 +00:00
adding extra detail on delegtion errors so LLM can recover
This commit is contained in:
@@ -45,12 +45,12 @@ class AgentTools(BaseModel):
|
|||||||
"""Execute the command."""
|
"""Execute the command."""
|
||||||
agent, task, information = command.split("|")
|
agent, task, information = command.split("|")
|
||||||
if not agent or not task or not information:
|
if not agent or not task or not information:
|
||||||
return "Error executing tool."
|
return "Error executing tool. Missing 3 pipe (|) separated values."
|
||||||
|
|
||||||
agent = [available_agent for available_agent in self.agents if available_agent.role == agent]
|
agent = [available_agent for available_agent in self.agents if available_agent.role == agent]
|
||||||
|
|
||||||
if len(agent) == 0:
|
if len(agent) == 0:
|
||||||
return "Error executing tool."
|
return "Error executing tool. Co-worker not found, double check the co-worker."
|
||||||
|
|
||||||
agent = agent[0]
|
agent = agent[0]
|
||||||
result = agent.execute_task(task, information)
|
result = agent.execute_task(task, information)
|
||||||
|
|||||||
Reference in New Issue
Block a user