fix: memory 工具 required 数组添加 type — 解决模型持续不传 type 参数问题
Ollama function calling 依赖 JSON Schema 的 required 数组判断参数必要性, type 不在 required 中导致模型认为它是可选的,即使 error 提示了也不传。 将其加入 required 数组后,模型将被强制要求每次调用都提供 type 参数。
This commit is contained in:
@@ -367,7 +367,7 @@ export const TOOL_DEFINITIONS: ToolDefinition[] = [
|
||||
CRITICAL: For add action, you MUST include both "type" (fact/preference/rule) and "content" fields. If you omit them, the call will fail.`,
|
||||
parameters: {
|
||||
type: 'object',
|
||||
required: ['action'],
|
||||
required: ['action', 'type'],
|
||||
properties: {
|
||||
action: { type: 'string', enum: ['search', 'add', 'replace', 'remove', 'read_all'], description: 'Which operation to perform.' },
|
||||
query: { type: 'string', description: '[search] Keywords to search for.' },
|
||||
|
||||
Reference in New Issue
Block a user