From 18be23ae87672b40be8ac9783c2f2f5d2e65136b Mon Sep 17 00:00:00 2001 From: thzxx Date: Thu, 18 Jun 2026 14:49:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8E=BB=E6=8E=89=E7=A1=AC=E7=BC=96?= =?UTF-8?q?=E7=A0=81=E7=B4=A2=E5=BC=95=EF=BC=8C=E7=94=A8=E8=87=AA=E7=84=B6?= =?UTF-8?q?=E8=AF=AD=E8=A8=80=E5=88=86=E9=9A=94=E5=9B=BE=E7=89=87=E5=92=8C?= =?UTF-8?q?=E8=A7=86=E9=A2=91=E5=B8=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 图片和视频始终分块描述,最后追加'请分别分析,不要混淆'提示 --- src/renderer/components/input-area.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/renderer/components/input-area.ts b/src/renderer/components/input-area.ts index 025817c..36c513b 100644 --- a/src/renderer/components/input-area.ts +++ b/src/renderer/components/input-area.ts @@ -1013,12 +1013,12 @@ async function sendMessageWithAgentLoop(text: string, currentSession: ChatSessio apiParts.push(...fileParts); logInfo('📄 文件内容已注入', `${fileParts.length} 段, 共 ${fileContents.reduce((s, f) => s + f.content.length, 0)} 字符`); } - // 独立图片(与 images 数组前 N 张对应,在视频帧之前描述) + // 图片和视频帧按顺序分块描述(images 数组:图片在前,视频帧在后) if (pendingImages.length === 1) { - apiParts.push(`[独立图片: ${pendingImages[0].name}](images[0],请单独分析)`); + apiParts.push(`[独立图片: ${pendingImages[0].name}](请单独分析该图片,勿与视频帧混淆)`); } else if (pendingImages.length > 1) { const imgNames = pendingImages.map(img => img.name).join(', '); - apiParts.push(`[${pendingImages.length} 张独立图片: ${imgNames}](images[0..${pendingImages.length - 1}],请分别分析)`); + apiParts.push(`[${pendingImages.length} 张独立图片: ${imgNames}](请分别分析每张图片,勿与视频帧混淆)`); } let allVids: Array<{ name: string; count: number; dur: number; frames: Array<{ timestampSeconds: number; name: string }> }> = []; if (hasVideos) { @@ -1033,10 +1033,11 @@ async function sendMessageWithAgentLoop(text: string, currentSession: ChatSessio const fl = v.frames.map(f => ` ${String(f.timestampSeconds).padStart(4, ' ')}s — ${f.name}`).join('\n'); parts.push(`[视频帧序列 · ${v.name} · ${v.count}帧 · 1fps · ${v.dur.toFixed(0)}s]\n${fl}`); } - const offset = pendingImages.length; - apiParts.push(`以下 images[${offset}..${offset + allVids.reduce((s, v) => s + v.count, 0) - 1}] 为视频帧序列:`); apiParts.push(parts.join('\n\n')); - apiParts.push('上述帧按时间顺序排列,帧间存在时序关系。请分析视频内容。'); + apiParts.push('以上为视频帧序列,按时间顺序排列,帧间存在时序关系。请分析视频内容。'); + } + if (pendingImages.length > 0 && hasVideos) { + apiParts.push('注意:独立图片和视频帧是不同的内容,请分别分析,不要混淆。'); } apiContentForModel = apiParts.join('\n\n');