Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Commit

Permalink
Fix Issue [Bug] systemPrompts not effective ChatGPTNextWeb#3152
Browse files Browse the repository at this point in the history
[+] refactor(chat.ts): change systemPrompts variable declaration to explicitly specify type as ChatMessage[]
[+] feat(chat.ts): add systemPrompt to systemPrompts array
  • Loading branch information
H0llyW00dzZ committed Nov 7, 2023
1 parent dd5abd4 commit d748000
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/store/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -422,7 +422,8 @@ export const useChatStore = createPersistStore(
}),
});
console.log("[Global System Prompt] ", systemPrompt.content);
}
systemPrompts.push(systemPrompt);
}

// long term memory
const shouldSendLongTermMemory =
Expand Down

0 comments on commit d748000

Please sign in to comment.