feat: enhance local knowledge retrieval

This commit is contained in:
lofyer
2026-08-12 21:45:47 +08:00
parent e0e5a8c1b3
commit 111f487e20
65 changed files with 13517 additions and 1155 deletions
+4 -5
View File
@@ -208,7 +208,7 @@ export type ModelToolResult = {
export type ModelToolCallContext = {
conversationId: string
workMode: 'ask' | 'plan' | 'execute'
workMode: 'ask' | 'execute'
knowledgeCapabilityToken?: string
}
@@ -1218,10 +1218,9 @@ export class ModelToolProvider implements ModelToolProviderLike {
): Promise<ModelToolDefinition[]> {
signal.throwIfAborted()
const scopedTools = this.getScopedTools(context)
const webTools =
this.webSearchEnabled && context.workMode !== 'plan'
? this.getWebSearchDefinitions()
: []
const webTools = this.webSearchEnabled
? this.getWebSearchDefinitions()
: []
if (context.workMode !== 'execute') {
return [...webTools, ...scopedTools]
}