refactoring default agent tools

This commit is contained in:
João Moura
2024-02-12 13:27:02 -08:00
parent e8e3617ba6
commit 6e399101fd
3 changed files with 11 additions and 11 deletions

View File

@@ -20,14 +20,14 @@ class AgentTools(BaseModel):
func=self.delegate_work,
name="Delegate work to co-worker",
description=self.i18n.tools("delegate_work").format(
coworkers=", ".join([agent.role for agent in self.agents])
coworkers="\n".join([f"- {agent.role}" for agent in self.agents])
),
),
StructuredTool.from_function(
func=self.ask_question,
name="Ask question to co-worker",
description=self.i18n.tools("ask_question").format(
coworkers=", ".join([agent.role for agent in self.agents])
coworkers="\n".join([f"- {agent.role}" for agent in self.agents])
),
),
]
@@ -50,7 +50,7 @@ class AgentTools(BaseModel):
if not agent:
return self.i18n.errors("agent_tool_unexsiting_coworker").format(
coworkers=", ".join([agent.role for agent in self.agents])
coworkers="\n".join([f"- {agent.role}" for agent in self.agents])
)
agent = agent[0]