From 981edcaf4419c56ae01da79ff83e953af3a651ee Mon Sep 17 00:00:00 2001 From: yetone Date: Sun, 2 Mar 2025 16:27:05 +0800 Subject: [PATCH] fix: do not use tools aggressively (#1462) --- lua/avante/templates/_tools-guidelines.avanterules | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/avante/templates/_tools-guidelines.avanterules b/lua/avante/templates/_tools-guidelines.avanterules index db8ae2a..8629f99 100644 --- a/lua/avante/templates/_tools-guidelines.avanterules +++ b/lua/avante/templates/_tools-guidelines.avanterules @@ -2,6 +2,9 @@ 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. + - Please DON'T be so aggressive in using tools, as many tasks can be better completed without tools. + - Files will be provided to you as context through and tags! + - If you need to read a file that is already in the context, do not use the `read_file` tool again; directly use the content from the context. - If the `rag_search` tool exists, prioritize using it to do the search! - 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! @@ -13,5 +16,4 @@ 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. + - Do not use the `python` tool to read or modify files!