Skip to content

Commit b398952

Browse files
fix: prepend system prompt to multimodal history before generateMultimodal
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 87fa1f0 commit b398952

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

packages/react-native-executorch/src/controllers/LLMController.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,14 @@ export class LLMController {
319319

320320
if (updatedHistory.some((m) => m.mediaPath)) {
321321
// Any message in history has media — use multimodal path
322+
const historyWithSystemPrompt = [
323+
{ content: this.chatConfig.systemPrompt, role: 'system' as const },
324+
...updatedHistory,
325+
];
322326
try {
323327
this.isGeneratingCallback(true);
324328
response = await this.nativeModule.generateMultimodal(
325-
updatedHistory,
329+
historyWithSystemPrompt,
326330
this.onToken
327331
);
328332
} catch (e) {

0 commit comments

Comments
 (0)