jack hai 1 mes
pai
achega
473e70d480
Modificáronse 1 ficheiros con 18 adicións e 1 borrados
  1. 18 1
      app/core/tools/file_search_tool.py

+ 18 - 1
app/core/tools/file_search_tool.py

@@ -138,7 +138,24 @@ class FileSearchTool(BaseTool):
         if (self.__keys and len(self.__keys) > 0) or (
             self.__dirkeys and len(self.__dirkeys) > 0
         ):
-            return '## important:You can use the "retrieval or file_search" tool to search for relevant information.'
+            return (
+                "## 工具使用规范"
+                + "可调用工具:"
+                + "- file_search:根据关键词或短语检索指定文件中的内容,返回匹配的文本片段的内容"
+                + "**调用规则**:"
+                + "1. 当问题涉及以下情况时必须调用本工具:"
+                + "   - 询问文件/文档中的具体内容"
+                + "   - 需要查找数据、条款或技术细节"
+                + '   - 用户明确要求"查文件"或"搜索资料"'
+                + "2. 调用时需遵循:"
+                + "   ```json"
+                + "   {"
+                + '     "action": "file_search",'
+                + '     "action_input": {'
+                + '       "query": "精炼后的要搜索的关键词或短语,支持精确匹配"'
+                + "     }"
+                + "   }"
+            )
         else:
             return ""
         # return '## important:You can use the "retrieval" tool to search for relevant information.\n If you are asking about the content of the files, please specify any keywords, topics, or context you are looking for to help retrieve the most relevant content.'