|
@@ -27,11 +27,21 @@ class FileSearchToolInput(BaseModel):
|
|
|
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."
|
|
|
+ "当遇到以下情况时,你必须直接调用[filesearch]工具:"
|
|
|
+ + "1. 用户需要从文件/文档中检索具体内容"
|
|
|
+ + "2. 涉及查找数据、条款或技术细节"
|
|
|
+ + '3. 明确出现"搜索文档"、"查找文件"等指令'
|
|
|
+ + "调用规范:"
|
|
|
+ + "1. 自动从对话中提取以下参数:"
|
|
|
+ + ' - query: "The keyword or phrase to search for, supporting exact matches."'
|
|
|
+ + "2. 严格使用JSON格式发起函数调用:"
|
|
|
+ + "```json"
|
|
|
+ + "{"
|
|
|
+ + ' "tool": "filesearch",'
|
|
|
+ + ' "parameters": {'
|
|
|
+ + ' query:"The keyword or phrase to search for, supporting exact matches."'
|
|
|
+ + " }"
|
|
|
+ + "}"
|
|
|
)
|
|
|
|
|
|
args_schema: Type[BaseModel] = FileSearchToolInput
|