mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 16:18:30 +00:00
arguments descriptions added to tool description
so now the agent knows how to use the tools params
This commit is contained in:
@@ -86,13 +86,16 @@ class BaseTool(BaseModel, ABC):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def _generate_description(self):
|
def _generate_description(self):
|
||||||
args = []
|
args = []
|
||||||
for arg, attribute in self.args_schema.schema()["properties"].items():
|
args_description = []
|
||||||
if "type" in attribute:
|
for arg, attribute in self.args_schema.schema()["properties"].items():
|
||||||
args.append(f"{arg}: '{attribute['type']}'")
|
if "type" in attribute:
|
||||||
|
args.append(f"{arg}: '{attribute['type']}'")
|
||||||
|
if "description" in attribute:
|
||||||
|
args_description.append(f"{arg}: '{attribute['description']}'")
|
||||||
|
|
||||||
description = self.description.replace("\n", " ")
|
description = self.description.replace("\n", " ")
|
||||||
self.description = f"{self.name}({', '.join(args)}) - {description}"
|
self.description = f"{self.name}({', '.join(args)}) - {description} {', '.join(args_description)}"
|
||||||
|
|
||||||
|
|
||||||
class Tool(BaseTool):
|
class Tool(BaseTool):
|
||||||
|
|||||||
Reference in New Issue
Block a user