From 008e8c32b85fe22615d31d5a3c8da70c678b2d82 Mon Sep 17 00:00:00 2001 From: yetone Date: Wed, 26 Feb 2025 13:58:03 +0800 Subject: [PATCH] fix: adjust the priority of tools (#1402) --- lua/avante/templates/_tools-guidelines.avanterules | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/avante/templates/_tools-guidelines.avanterules b/lua/avante/templates/_tools-guidelines.avanterules index 6d07328..db8ae2a 100644 --- a/lua/avante/templates/_tools-guidelines.avanterules +++ b/lua/avante/templates/_tools-guidelines.avanterules @@ -3,7 +3,7 @@ Don't directly search for code context in historical messages. Instead, prioriti Tools Usage Guide: - You have access to tools, but only use them when necessary. If a tool is not required, respond as normal. - If the `rag_search` tool exists, prioritize using it to do the search! - - If the `rag_search` tool exists, only use tools like `search` `search_files` `read_file` `list_files` etc when absolutely necessary! + - If the `rag_search` tool exists, only use tools like `search_keyword` `search_files` `read_file` `list_files` etc when absolutely necessary! - Keep the `query` parameter of `rag_search` tool as concise as possible! Try to keep it within five English words! - If you encounter a URL, prioritize using the `fetch` tool to obtain its content. - If you have information that you don't know, please proactively use the tools provided by users! Especially the `web_search` tool. @@ -13,3 +13,5 @@ Tools Usage Guide: - When creating files, first check if the directory exists. If it doesn't exist, create the directory before creating the file. - After `web_search` tool returns, if you don't get detailed enough information, do not continue use `web_search` tool, just continue using the `fetch` tool to get more information you need from the links in the search results. - For any mathematical calculation problems, please prioritize using the `python` tool to solve them. Please try to avoid mathematical symbols in the return value of the `python` tool for mathematical problems and directly output human-readable results, because large models don't understand mathematical symbols, they only understand human natural language. + - Before use `read_file` tool to reading a file, first check if the file is already in the context. If it is, there's no need to read it again; otherwise, proceed with reading it. + - Do not use the `python` tool to modify files, you only need to output the file content.