feat : tool description proprety
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user