From d7480000cd85af20c61181e92cb9e94596ce03c3 Mon Sep 17 00:00:00 2001 From: H0llyW00dzZ Date: Tue, 7 Nov 2023 17:29:00 +0700 Subject: [PATCH] Fix Issue [Bug] systemPrompts not effective #3152 [+] refactor(chat.ts): change systemPrompts variable declaration to explicitly specify type as ChatMessage[] [+] feat(chat.ts): add systemPrompt to systemPrompts array --- app/store/chat.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/store/chat.ts b/app/store/chat.ts index 4f925efeabc..269769ffe70 100644 --- a/app/store/chat.ts +++ b/app/store/chat.ts @@ -402,7 +402,7 @@ export const useChatStore = createPersistStore( // system prompts, to get close to OpenAI Web ChatGPT const shouldInjectSystemPrompts = modelConfig.enableInjectSystemPrompts; - let systemPrompts = shouldInjectSystemPrompts ? [] : []; + let systemPrompts: ChatMessage[] = shouldInjectSystemPrompts ? [] : []; if (shouldInjectSystemPrompts) { const model = modelConfig.model; @@ -422,7 +422,8 @@ export const useChatStore = createPersistStore( }), }); console.log("[Global System Prompt] ", systemPrompt.content); - } + systemPrompts.push(systemPrompt); + } // long term memory const shouldSendLongTermMemory =