Refractoring (#88)

Co-authored-by: João Moura <joaomdmoura@gmail.com>
This commit is contained in:
SashaXser
2024-01-10 07:04:13 +04:00
committed by GitHub
parent ae385eca06
commit f6de0928c4
6 changed files with 16 additions and 28 deletions

View File

@@ -68,9 +68,8 @@ class AgentTools(BaseModel):
if available_agent.role == agent
]
if len(agent) == 0:
if not agent:
return f"\nError executing tool. Co-worker mentioned on the Action Input not found, it must to be one of the following options: {', '.join([agent.role for agent in self.agents])}.\n"
agent = agent[0]
result = agent.execute_task(task, context)
return result
return agent.execute_task(task, context)