Skip to content

Commit eaa55cb

Browse files
committed
fix: put text string first in multimodal_text parts (ChatGPT API requires string as parts[0])
1 parent aecbd94 commit eaa55cb

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎chrome_extension/injected.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,8 @@
604604
});
605605
}
606606
var cleanText = text.replace(/\[Image attached:[^\]]+\]/g, '').replace(/!\[[^\]]*\]\(data:[^)]+\)/g, '').replace(/!\[[^\]]*\]\(data:[^)]*$/g, '').trim();
607-
parts.push(cleanText || 'Please analyze the attached image.');
607+
parts.unshift(cleanText || 'Please analyze the attached image.');
608+
bridgeLog('parts count=' + parts.length + ' parts[0] type=' + typeof parts[0] + ' parts[1] type=' + (parts[1] ? typeof parts[1] : 'N/A'));
608609
var msgObj = {
609610
id: crypto.randomUUID(),
610611
author: { role: m.role || 'user' },

0 commit comments

Comments
 (0)