feat : tool description proprety

This commit is contained in:
martin legrand
2025-05-04 19:29:31 +02:00
parent 7afb79117b
commit 5949540007
3 changed files with 11 additions and 2 deletions
+9
View File
@@ -96,6 +96,15 @@ class Agent():
"""
return list(self.tools.keys())
def get_tools_description(self) -> str:
"""
Get the list of tools names and their description.
"""
description = ""
for name in self.get_tools_name():
description += f"{tool}: {self.tools[name].description}\n"
return description
def load_prompt(self, file_path: str) -> str:
try:
with open(file_path, 'r', encoding="utf-8") as f:
+1 -2
View File
@@ -41,8 +41,7 @@ class McpAgent(Agent):
"""
Expands the prompt with the tools available.
"""
tools_name = self.get_tools_name()
tools_str = ", ".join(tools_name)
tools_str = self.get_tools_description()
prompt += f"""
You can use the following tools and MCPs:
{tools_str}