|
@@ -28,10 +28,17 @@ class FileSearchToolInput(BaseModel):
|
|
|
class FileSearchTool(BaseTool):
|
|
|
name: str = "file_search"
|
|
|
description: str = (
|
|
|
- "Can be used to search through content of files uploaded by the user."
|
|
|
- + "If the user references specific file content (e.g., 'in my uploaded document...'), this function should be triggered."
|
|
|
- + "If the user has uploaded files in multiple batches, and their request is ambiguous (e.g. 'summarize the documents'), default to summarizing only the most recent batch of uploaded files. If the user's intent is to include older files, they should specify this explicitly."
|
|
|
- + "Singleton operation: Strictly 1 invocation per API call"
|
|
|
+ "Triggers when user requests summary/overview of uploaded files OR references specific file content. "
|
|
|
+ "Explicit trigger phrases include: '帮我总结', '总结一下', '文件的内容有什么', '文件说了什么', 'summarize', 'overview', 'what's in the files'. "
|
|
|
+ "Behavior rules: "
|
|
|
+ "1. For ambiguous requests (e.g. '总结文档'), process only the most recent file batch by default "
|
|
|
+ "2. Requires explicit user instruction (e.g. '包括所有批次') to process older batches "
|
|
|
+ "3. Strict singleton operation: 1 invocation maximum per API call "
|
|
|
+ "4. Always verify file availability before triggering"
|
|
|
+ # "Can be used to search through content of files uploaded by the user."
|
|
|
+ # + "If the user references specific file content (e.g., 'in my uploaded document...'), this function should be triggered."
|
|
|
+ # + "If the user has uploaded files in multiple batches, and their request is ambiguous (e.g. 'summarize the documents'), default to summarizing only the most recent batch of uploaded files. If the user's intent is to include older files, they should specify this explicitly."
|
|
|
+ # + "Singleton operation: Strictly 1 invocation per API call"
|
|
|
)
|
|
|
args_schema: Type[BaseModel] = FileSearchToolInput
|
|
|
|
|
@@ -125,4 +132,4 @@ class FileSearchTool(BaseTool):
|
|
|
):
|
|
|
return ""
|
|
|
else:
|
|
|
- return "如果您不确定用户发的文件内容或者代码库结构,请使用文件搜索工具读取内容并收集相关信息,不要瞎猜或者编造答案。"
|
|
|
+ return "如果您不确定用户发的文件内容或者代码库结构,请使用file_search工具读取内容并收集相关信息,不要瞎猜或者编造答案。"
|