jack 1 개월 전
부모
커밋
4532a234cf
1개의 변경된 파일11개의 추가작업 그리고 12개의 파일을 삭제
  1. 11 12
      app/core/tools/file_search_tool.py

+ 11 - 12
app/core/tools/file_search_tool.py

@@ -15,22 +15,21 @@ import nest_asyncio
 nest_asyncio.apply()
 
 # asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
-
-
-class FileSearchToolInput(BaseModel):
+        """
+        "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."
+        """
     # query: str = Field(..., description="query to look up in retrieval")
-    query: str = Field(description="要搜索的关键词或短语,支持精确匹配.")
+    
+class FileSearchToolInput(BaseModel):
+    query: str = Field(..., description="要搜索的关键词或短语,支持精确匹配.")
 
 
 class FileSearchTool(BaseTool):
     name: str = "file_search"
     description: str = (
         "根据关键词或短语检索指定文件中的内容,返回匹配的文本片段的内容"
-        """
-        "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
@@ -146,8 +145,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 '## important:You can use the "retrieval or file_search" tool to search for relevant information.'
+'''
             return (
                 "## 工具使用规范"
                 + "可调用工具:"
@@ -166,7 +165,7 @@ class FileSearchTool(BaseTool):
                 + "     }"
                 + "   }"
             )
-
+'''
         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.'