mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-11 00:58:30 +00:00
improving agent tools descriptions
This commit is contained in:
@@ -15,22 +15,23 @@ class AgentTools(BaseModel):
|
|||||||
i18n: I18N = Field(default=I18N(), description="Internationalization settings.")
|
i18n: I18N = Field(default=I18N(), description="Internationalization settings.")
|
||||||
|
|
||||||
def tools(self):
|
def tools(self):
|
||||||
return [
|
tools = [
|
||||||
StructuredTool.from_function(
|
StructuredTool.from_function(
|
||||||
func=self.delegate_work,
|
func=self.delegate_work,
|
||||||
name="Delegate work to co-worker",
|
name="Delegate work to co-worker",
|
||||||
description=self.i18n.tools("delegate_work").format(
|
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(
|
StructuredTool.from_function(
|
||||||
func=self.ask_question,
|
func=self.ask_question,
|
||||||
name="Ask question to co-worker",
|
name="Ask question to co-worker",
|
||||||
description=self.i18n.tools("ask_question").format(
|
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):
|
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."""
|
"""Useful to delegate a specific task to a coworker passing all necessary context and names."""
|
||||||
|
|||||||
Reference in New Issue
Block a user