From 59495400079064e5414ed49cb0296a4ab6e852af Mon Sep 17 00:00:00 2001 From: martin legrand Date: Sun, 4 May 2025 19:29:31 +0200 Subject: [PATCH] feat : tool description proprety --- sources/agents/agent.py | 9 +++++++++ sources/agents/mcp_agent.py | 3 +-- sources/router.py | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/sources/agents/agent.py b/sources/agents/agent.py index 14c6c77..6f1e93d 100644 --- a/sources/agents/agent.py +++ b/sources/agents/agent.py @@ -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: diff --git a/sources/agents/mcp_agent.py b/sources/agents/mcp_agent.py index e24b04d..b51b76d 100644 --- a/sources/agents/mcp_agent.py +++ b/sources/agents/mcp_agent.py @@ -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} diff --git a/sources/router.py b/sources/router.py index 50e8178..61d9808 100644 --- a/sources/router.py +++ b/sources/router.py @@ -171,6 +171,7 @@ class AgentRouter: ("Search the web for the latest trends in web development and build a sample site", "HIGH"), ("Use my research_note.txt file, double check the informations on the web", "HIGH"), ("Make a web server in go that query a flight API and display them in a app", "HIGH"), + ("Search the web for top cafes in Rennes, France, and save a list of three with their addresses in rennes_cafes.txt.", "HIGH"), ("Search the web for the latest trends in AI and demo it in pytorch", "HIGH"), ("can you lookup for api that track flight and build a web flight tracking app", "HIGH"), ("Find the file toto.pdf then use its content to reply to Jojo on superforum.com", "HIGH"),