jack 1 miesiąc temu
rodzic
commit
371c0281f0
1 zmienionych plików z 5 dodań i 9 usunięć
  1. 5 9
      app/core/tools/file_search_tool.py

+ 5 - 9
app/core/tools/file_search_tool.py

@@ -19,22 +19,15 @@ nest_asyncio.apply()
 
 class FileSearchToolInput(BaseModel):
     # query: str = Field(..., description="query to look up in retrieval")
-    query: str = Field(
-        description="Search term (keyword) or natural language query for semantic search."
-    )
+    query: str = Field(description="query to look up in retrieval.")
 
 
 class FileSearchTool(BaseTool):
     name: str = "file_search"
     description: str = (
-        "Search files by keyword, content, or semantic similarity. Returns file paths and relevant snippets for RAG."
-        """
-        "Can be used to look up information that was uploaded to this assistant."
-        "If the user is referencing particular files, that is often a good hint that information may be here."
         "A search engine optimized for comprehensive, accurate, and trusted results. "
         "Useful for when you need to answer questions about current events. "
         "Input should be a search query."
-        """
     )
 
     args_schema: Type[BaseModel] = FileSearchToolInput
@@ -150,6 +143,8 @@ 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 (
                 "## 工具使用规范"
                 + "可调用工具:"
@@ -162,12 +157,13 @@ class FileSearchTool(BaseTool):
                 + "2. 调用时需遵循:"
                 + "   ```json"
                 + "   {"
-                + '     "action": "retrieval",'
+                + '     "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.'