jack 1 месяц назад
Родитель
Сommit
07f2a26788
1 измененных файлов с 7 добавлено и 3 удалено
  1. 7 3
      app/core/tools/file_search_tool.py

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

@@ -18,12 +18,16 @@ 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="query to look up in retrieval")
 
 
 class FileSearchTool(BaseTool):
     name: str = "file_search"
-    description: str = "根据关键词或短语检索指定文件中的内容,返回匹配的文本片段的内容"
+    description: str = (
+        "Use this tool to search for information from files uploaded to this assistant."
+        "When users mention file retrieval, it's often an indication that relevant information may be available here."
+        "This is especially helpful for answering questions related to current events or file-based inquiries."
+    )
 
     args_schema: Type[BaseModel] = FileSearchToolInput
 
@@ -138,6 +142,6 @@ 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" 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.'
+            return '## important:You can use the "retrieval" tool to search for relevant information. 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.'
         else:
             return ""