From 66d0f448c44ef39b366ac7bb5c6646bf6713aec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moura?= Date: Sun, 24 Mar 2024 11:10:13 -0300 Subject: [PATCH] improving agent tools descriptions --- src/crewai/tools/agent_tools.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/crewai/tools/agent_tools.py b/src/crewai/tools/agent_tools.py index fd489db73..43796fd64 100644 --- a/src/crewai/tools/agent_tools.py +++ b/src/crewai/tools/agent_tools.py @@ -15,22 +15,23 @@ class AgentTools(BaseModel): i18n: I18N = Field(default=I18N(), description="Internationalization settings.") def tools(self): - return [ + tools = [ StructuredTool.from_function( func=self.delegate_work, name="Delegate work to co-worker", description=self.i18n.tools("delegate_work").format( - coworkers=[f"{agent.role}" for agent in self.agents] + coworkers=f"[{', '.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=[f"{agent.role}" for agent in self.agents] + coworkers=f"[{', '.join([f'{agent.role}' for agent in self.agents])}]" ), ), ] + return tools def delegate_work(self, coworker: str, task: str, context: str): """Useful to delegate a specific task to a coworker passing all necessary context and names."""