v0.16.2: 附件JSON增加description字段,避免AI重复调用文件读取工具

This commit is contained in:
thzxx
2026-07-12 08:19:59 +08:00
parent b8ea18e568
commit 4326fcce42
+2
View File
@@ -955,6 +955,7 @@ function buildFileContentParts(fileContents: Array<{ name: string; language: str
return JSON.stringify({ return JSON.stringify({
file_name: f.name, file_name: f.name,
file_type: lang, file_type: lang,
description: '用户上传的附件,内容已包含在 context 字段中,无需使用文件读取工具再次读取。',
context: text, context: text,
}); });
}).filter(Boolean); }).filter(Boolean);
@@ -1141,6 +1142,7 @@ async function sendMessageWithAgentLoop(text: string, currentSession: ChatSessio
apiParts.push(JSON.stringify({ apiParts.push(JSON.stringify({
file_name: v.name, file_name: v.name,
file_type: v.name.split('.').pop() || 'video', file_type: v.name.split('.').pop() || 'video',
description: '用户上传的视频附件,帧图片已通过 images 数组传递,帧索引映射已包含在 context 字段中,无需使用文件读取工具再次读取。',
context: JSON.stringify({ context: JSON.stringify({
frame_count: v.count, frame_count: v.count,
fps: 1, fps: 1,