jack 1 ヶ月 前
コミット
20273f1b59
1 ファイル変更10 行追加7 行削除
  1. 10 7
      app/core/tools/file_search_tool.py

+ 10 - 7
app/core/tools/file_search_tool.py

@@ -18,17 +18,20 @@ nest_asyncio.apply()
 # asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
 # query: str = Field(..., description="query to look up in retrieval")
 class FileSearchToolInput(BaseModel):
-    query: str = Field(..., description="要搜索的关键词或短语,支持精确匹配.")
+    query: str = Field(
+        ...,
+        description="The keyword or phrase to search for, supporting exact matches.",
+    )
 
 
 class FileSearchTool(BaseTool):
     name: str = "file_search"
     description: str = (
-        "当问题涉及以下情况时必须调用本工具:"
-        + "   - 询问文件/文档中的具体内容"
-        + "   - 需要查找数据、条款或技术细节"
-        + '   - 用户明确要求"查文件"或"搜索资料"'
-        "根据上面要求的关键词或短语检索指定需要文件中的内容,这里可以返回匹配的文本片段的内容"
+        "This tool must be called when the question involves the following situations:"
+        + "   - Asking for specific content in files/documents"
+        + "   - Need to find data, terms, or technical details"
+        + '   - The user explicitly requests "search files" or "search materials"'
+        "Retrieves content from specified files based on the keywords or phrases requested above, returning matching text snippets."
     )
 
     args_schema: Type[BaseModel] = FileSearchToolInput
@@ -144,7 +147,7 @@ class FileSearchTool(BaseTool):
         if (self.__keys and len(self.__keys) > 0) or (
             self.__dirkeys and len(self.__dirkeys) > 0
         ):
-            return ""
+            return "## important:You can use the "retrieval" tool to search for relevant information."
         else:
             return ""