From adb9c4ec40195c9c44ab48496f9fbb5855b99cfb Mon Sep 17 00:00:00 2001 From: Algorithm5838 <108630393+Algorithm5838@users.noreply.github.com> Date: Thu, 28 Dec 2023 23:16:40 +0300 Subject: [PATCH 1/3] Update chat.ts --- app/store/chat.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/store/chat.ts b/app/store/chat.ts index dff6b7bf1c6..f7a3caa04df 100644 --- a/app/store/chat.ts +++ b/app/store/chat.ts @@ -7,6 +7,7 @@ import { createEmptyMask, Mask } from "./mask"; import { DEFAULT_INPUT_TEMPLATE, DEFAULT_SYSTEM_TEMPLATE, + CHATGPT_SYSTEM_TEMPLATE, KnowledgeCutOffDate, ModelProvider, StoreKey, @@ -386,9 +387,7 @@ export const useChatStore = createPersistStore( const contextPrompts = session.mask.context.slice(); // system prompts, to get close to OpenAI Web ChatGPT - const shouldInjectSystemPrompts = - modelConfig.enableInjectSystemPrompts && - session.mask.modelConfig.model.startsWith("gpt-"); + const shouldInjectSystemPrompts = modelConfig.enableInjectSystemPrompts; var systemPrompts: ChatMessage[] = []; systemPrompts = shouldInjectSystemPrompts @@ -397,7 +396,7 @@ export const useChatStore = createPersistStore( role: "system", content: fillTemplateWith("", { ...modelConfig, - template: DEFAULT_SYSTEM_TEMPLATE, + template: modelConfig.model.startsWith('gpt') ? CHATGPT_SYSTEM_TEMPLATE : DEFAULT_SYSTEM_TEMPLATE, }), }), ] From 0660bd268e91c5a11e202281f6e33c429dd80c26 Mon Sep 17 00:00:00 2001 From: Algorithm5838 <108630393+Algorithm5838@users.noreply.github.com> Date: Thu, 28 Dec 2023 23:18:49 +0300 Subject: [PATCH 2/3] Update constant.ts --- app/constant.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/constant.ts b/app/constant.ts index 7668381c1fa..4a3c071c070 100644 --- a/app/constant.ts +++ b/app/constant.ts @@ -96,6 +96,13 @@ export const Google = { export const DEFAULT_INPUT_TEMPLATE = `{{input}}`; // input / time / model / lang export const DEFAULT_SYSTEM_TEMPLATE = ` +You are a helpful assistant. +Current model: {{model}} +Current time: {{time}} +Latex inline: $x^2$ +Latex block: $$e=mc^2$$ +`; +export const CHATGPT_SYSTEM_TEMPLATE = ` You are ChatGPT, a large language model trained by OpenAI. Knowledge cutoff: {{cutoff}} Current model: {{model}} From 65baeea1e14ed05816a6d624a8cc862da2568ed3 Mon Sep 17 00:00:00 2001 From: Algorithm5838 <108630393+Algorithm5838@users.noreply.github.com> Date: Sun, 14 Jan 2024 04:26:32 +0300 Subject: [PATCH 3/3] Update constant.ts --- app/constant.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/constant.ts b/app/constant.ts index 1cc469d3ba1..2fe548e613f 100644 --- a/app/constant.ts +++ b/app/constant.ts @@ -98,8 +98,6 @@ export const DEFAULT_SYSTEM_TEMPLATE = ` You are a helpful assistant. Current model: {{model}} Current time: {{time}} -Latex inline: $x^2$ -Latex block: $$e=mc^2$$ `; export const CHATGPT_SYSTEM_TEMPLATE = ` You are ChatGPT, a large language model trained by OpenAI.