From 5e361f6748f92bdb3261097576c6ed8c38dd034f Mon Sep 17 00:00:00 2001 From: imldy Date: Mon, 10 Jul 2023 18:56:22 +0800 Subject: [PATCH 1/4] =?UTF-8?q?dev:=20=E5=A2=9E=E5=8A=A0=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=A1=B9=EF=BC=9A=E6=98=AF=E5=90=A6=E5=90=AF?= =?UTF-8?q?=E7=94=A8=E6=B3=A8=E5=85=A5=E5=85=A8=E5=B1=80=20System=20Prompt?= =?UTF-8?q?=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/model-config.tsx | 16 ++++++++++++++++ app/locales/cn.ts | 5 ++++- app/store/config.ts | 7 ++++++- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/app/components/model-config.tsx b/app/components/model-config.tsx index 9603eea0..76866129 100644 --- a/app/components/model-config.tsx +++ b/app/components/model-config.tsx @@ -130,6 +130,22 @@ export function ModelConfigList(props: { > + + + props.updateConfig( + (config) => + (config.enableInjectSystemPrompts = e.currentTarget.checked), + ) + } + > + + ()( }), { name: StoreKey.Config, - version: 3.5, + version: 3.6, migrate(persistedState, version) { const state = persistedState as ChatConfig; @@ -165,6 +166,10 @@ export const useAppConfig = create()( state.customModels = "claude,claude-100k"; } + if (version < 3.6) { + state.modelConfig.enableInjectSystemPrompts = true; + } + return state as any; }, }, From 1513881eed064768da907a52d76ae869d771fd09 Mon Sep 17 00:00:00 2001 From: imldy Date: Mon, 10 Jul 2023 18:57:54 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E5=BA=94=E8=AF=A5=E6=B3=A8=E5=85=A5System=20Prompt=E7=9A=84?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E8=A7=84=E5=88=99=E4=B8=BA=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/store/chat.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/store/chat.ts b/app/store/chat.ts index ea2c472f..6b403dd6 100644 --- a/app/store/chat.ts +++ b/app/store/chat.ts @@ -387,8 +387,7 @@ export const useChatStore = create()( const contextPrompts = session.mask.context.slice(); // system prompts, to get close to OpenAI Web ChatGPT - // only will be injected if user does not use a mask or set none context prompts - const shouldInjectSystemPrompts = contextPrompts.length === 0; + const shouldInjectSystemPrompts = modelConfig.enableInjectSystemPrompts; const systemPrompts = shouldInjectSystemPrompts ? [ createMessage({ From 2930ba0457777319b05ea305956f86ebcc87a6a7 Mon Sep 17 00:00:00 2001 From: imldy Date: Mon, 10 Jul 2023 20:12:51 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9InjectSystemPrompt?= =?UTF-8?q?s.SubTitle=E4=BD=BF=E5=85=B6=E6=9B=B4=E7=AC=A6=E5=90=88?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E8=A1=8C=E4=B8=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/locales/cn.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/locales/cn.ts b/app/locales/cn.ts index 59a62086..e60e468a 100644 --- a/app/locales/cn.ts +++ b/app/locales/cn.ts @@ -141,7 +141,7 @@ const cn = { }, InjectSystemPrompts: { Title: "注入系统级提示信息", - SubTitle: "强制给每次请求的消息列表开头添加一个系统级提示", + SubTitle: "强制给每次请求的消息列表开头添加一个模拟 ChatGPT 的系统提示", }, InputTemplate: { Title: "用户输入预处理", From f59235bd5ac49d1da28e87ed678c7c0f0a6a90a9 Mon Sep 17 00:00:00 2001 From: imldy Date: Mon, 10 Jul 2023 20:14:10 +0800 Subject: [PATCH 4/4] =?UTF-8?q?feat:=20=E7=BF=BB=E8=AF=91InjectSystemPromp?= =?UTF-8?q?ts=E9=85=8D=E7=BD=AE=E9=A1=B9=E4=B8=BA=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E8=AF=AD=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/locales/ar.ts | 5 +++++ app/locales/bn.ts | 6 +++++- app/locales/cs.ts | 5 +++++ app/locales/de.ts | 5 +++++ app/locales/en.ts | 6 +++++- app/locales/es.ts | 5 +++++ app/locales/fr.ts | 5 +++++ app/locales/it.ts | 5 +++++ app/locales/jp.ts | 5 +++++ app/locales/ko.ts | 5 +++++ app/locales/no.ts | 5 +++++ app/locales/ru.ts | 5 +++++ app/locales/tr.ts | 5 +++++ app/locales/tw.ts | 4 ++++ app/locales/vi.ts | 5 +++++ 15 files changed, 74 insertions(+), 2 deletions(-) diff --git a/app/locales/ar.ts b/app/locales/ar.ts index b3b5c021..a86b1648 100644 --- a/app/locales/ar.ts +++ b/app/locales/ar.ts @@ -110,6 +110,11 @@ const ar: PartialLocaleType = { Title: "حجم الخط", SubTitle: "ضبط حجم الخط لمحتوى الدردشة", }, + InjectSystemPrompts: { + Title: "حقن تلميحات النظام", + SubTitle: + "قم بإضافة تلميحة نظام محاكاة ChatGPT إلى بداية قائمة الرسائل المُطلَبة في كل طلب", + }, InputTemplate: { Title: "نموذج الإدخال", SubTitle: "سيتم ملء أحدث رسالة في هذا النموذج", diff --git a/app/locales/bn.ts b/app/locales/bn.ts index 065f4276..9eda157f 100644 --- a/app/locales/bn.ts +++ b/app/locales/bn.ts @@ -135,7 +135,11 @@ const bn: PartialLocaleType = { Title: "ফন্ট সাইজ", SubTitle: "চ্যাট সামগ্রীর ফন্ট সাইজ সংশোধন করুন", }, - + InjectSystemPrompts: { + Title: "حقن تلميحات النظام", + SubTitle: + "قم بإضافة تلميحة نظام محاكاة ChatGPT إلى بداية قائمة الرسائل المُطلَبة في كل طلب", + }, InputTemplate: { Title: "ইনপুট টেমপ্লেট", SubTitle: "নতুনতম বার্তা এই টেমপ্লেটে পূরণ হবে", diff --git a/app/locales/cs.ts b/app/locales/cs.ts index 348e16af..63d2c237 100644 --- a/app/locales/cs.ts +++ b/app/locales/cs.ts @@ -71,6 +71,11 @@ const cs: PartialLocaleType = { Title: "Velikost písma", SubTitle: "Nastavení velikosti písma obsahu chatu", }, + InjectSystemPrompts: { + Title: "Vložit systémové prompty", + SubTitle: + "Vynutit přidání simulovaného systémového promptu ChatGPT na začátek seznamu zpráv každého požadavku", + }, Update: { Version: (x: string) => `Verze: ${x}`, IsLatest: "Aktuální verze", diff --git a/app/locales/de.ts b/app/locales/de.ts index d7e88cc8..e8d4dc9c 100644 --- a/app/locales/de.ts +++ b/app/locales/de.ts @@ -71,6 +71,11 @@ const de: PartialLocaleType = { Title: "Schriftgröße", SubTitle: "Schriftgröße des Chat-Inhalts anpassen", }, + InjectSystemPrompts: { + Title: "System-Prompts einfügen", + SubTitle: + "Erzwingt das Hinzufügen eines simulierten systemweiten Prompts von ChatGPT am Anfang der Nachrichtenliste bei jeder Anfrage", + }, Update: { Version: (x: string) => `Version: ${x}`, IsLatest: "Neueste Version", diff --git a/app/locales/en.ts b/app/locales/en.ts index f5d90fd2..de10ee31 100644 --- a/app/locales/en.ts +++ b/app/locales/en.ts @@ -141,7 +141,11 @@ const en: LocaleType = { Title: "Font Size", SubTitle: "Adjust font size of chat content", }, - + InjectSystemPrompts: { + Title: "Inject System Prompts", + SubTitle: + "Forcefully add a simulated ChatGPT system prompt at the beginning of the message list for every request", + }, InputTemplate: { Title: "Input Template", SubTitle: "Newest message will be filled to this template", diff --git a/app/locales/es.ts b/app/locales/es.ts index 0971f05c..5f5ffc75 100644 --- a/app/locales/es.ts +++ b/app/locales/es.ts @@ -71,6 +71,11 @@ const es: PartialLocaleType = { Title: "Tamaño de fuente", SubTitle: "Ajustar el tamaño de fuente del contenido del chat", }, + InjectSystemPrompts: { + Title: "Inyectar Prompts del Sistema", + SubTitle: + "Agregar forzosamente un prompt de sistema simulado de ChatGPT al comienzo de la lista de mensajes en cada solicitud", + }, Update: { Version: (x: string) => `Versión: ${x}`, IsLatest: "Última versión", diff --git a/app/locales/fr.ts b/app/locales/fr.ts index 700ee0ea..f4cd1490 100644 --- a/app/locales/fr.ts +++ b/app/locales/fr.ts @@ -111,6 +111,11 @@ const fr: PartialLocaleType = { Title: "Taille des polices", SubTitle: "Ajuste la taille de police du contenu de la conversation", }, + InjectSystemPrompts: { + Title: "Injecter des invites système", + SubTitle: + "Ajoute de force une invite système simulée de ChatGPT au début de la liste des messages pour chaque demande", + }, InputTemplate: { Title: "Template", SubTitle: "Le message le plus récent sera ajouté à ce template.", diff --git a/app/locales/it.ts b/app/locales/it.ts index acd3a7e9..4b74ff3f 100644 --- a/app/locales/it.ts +++ b/app/locales/it.ts @@ -71,6 +71,11 @@ const it: PartialLocaleType = { Title: "Dimensione carattere", SubTitle: "Regolare la dimensione dei caratteri del contenuto della chat", }, + InjectSystemPrompts: { + Title: "Inserisci Prompts di Sistema", + SubTitle: + "Aggiungi forzatamente un prompt di sistema simulato di ChatGPT all'inizio della lista dei messaggi per ogni richiesta", + }, Update: { Version: (x: string) => `Versione: ${x}`, IsLatest: "Ultima versione", diff --git a/app/locales/jp.ts b/app/locales/jp.ts index 090a428f..e27a4c6d 100644 --- a/app/locales/jp.ts +++ b/app/locales/jp.ts @@ -84,6 +84,11 @@ const jp: PartialLocaleType = { Title: "フォントサイズ", SubTitle: "チャット内容のフォントサイズ", }, + InjectSystemPrompts: { + Title: "システムプロンプトの挿入", + SubTitle: + "各リクエストのメッセージリストの先頭に、ChatGPTのシステムプロンプトを強制的に追加します", + }, InputTemplate: { Title: "入力の前処理", SubTitle: "新規入力がこのテンプレートに埋め込まれます", diff --git a/app/locales/ko.ts b/app/locales/ko.ts index 6f5ec7a9..ac5ee5df 100644 --- a/app/locales/ko.ts +++ b/app/locales/ko.ts @@ -71,6 +71,11 @@ const ko: PartialLocaleType = { Title: "글꼴 크기", SubTitle: "채팅 내용의 글꼴 크기 조정", }, + InjectSystemPrompts: { + Title: "시스템 프롬프트 주입", + SubTitle: + "각 요청의 메시지 목록의 시작에 ChatGPT 시스템 프롬프트를 강제로 추가합니다", + }, Update: { Version: (x: string) => `버전: ${x}`, IsLatest: "최신 버전", diff --git a/app/locales/no.ts b/app/locales/no.ts index b296bd5c..e4b83496 100644 --- a/app/locales/no.ts +++ b/app/locales/no.ts @@ -65,6 +65,11 @@ const no: PartialLocaleType = { Title: "Fontstørrelsen", SubTitle: "Juster fontstørrelsen for samtaleinnholdet.", }, + InjectSystemPrompts: { + Title: "Sett inn systemprompter", + SubTitle: + "Tving tillegg av en simulert ChatGPT-systemprompt i begynnelsen av meldingslisten for hver forespørsel", + }, Update: { Version: (x: string) => `Versjon: ${x}`, IsLatest: "Siste versjon", diff --git a/app/locales/ru.ts b/app/locales/ru.ts index 06c94585..76be21a3 100644 --- a/app/locales/ru.ts +++ b/app/locales/ru.ts @@ -71,6 +71,11 @@ const ru: PartialLocaleType = { Title: "Размер шрифта", SubTitle: "Настроить размер шрифта контента чата", }, + InjectSystemPrompts: { + Title: "Вставить системные подсказки", + SubTitle: + "Принудительно добавить симулированную системную подсказку ChatGPT в начало списка сообщений для каждого запроса", + }, Update: { Version: (x: string) => `Версия: ${x}`, IsLatest: "Последняя версия", diff --git a/app/locales/tr.ts b/app/locales/tr.ts index 2383a549..ad6b66fd 100644 --- a/app/locales/tr.ts +++ b/app/locales/tr.ts @@ -71,6 +71,11 @@ const tr: PartialLocaleType = { Title: "Yazı Boyutu", SubTitle: "Sohbet içeriğinin yazı boyutunu ayarlayın", }, + InjectSystemPrompts: { + Title: "Sistem İpucu Ekleyin", + SubTitle: + "Her istek için ileti listesinin başına simüle edilmiş bir ChatGPT sistem ipucu ekleyin", + }, Update: { Version: (x: string) => `Sürüm: ${x}`, IsLatest: "En son sürüm", diff --git a/app/locales/tw.ts b/app/locales/tw.ts index 1afb0eb7..d64294fa 100644 --- a/app/locales/tw.ts +++ b/app/locales/tw.ts @@ -69,6 +69,10 @@ const tw: PartialLocaleType = { Title: "字型大小", SubTitle: "聊天內容的字型大小", }, + InjectSystemPrompts: { + Title: "注入系統提示", + SubTitle: "強制在每個請求的訊息列表開頭添加一個模擬 ChatGPT 的系統提示", + }, Update: { Version: (x: string) => `當前版本:${x}`, IsLatest: "已是最新版本", diff --git a/app/locales/vi.ts b/app/locales/vi.ts index 428f9385..2117734b 100644 --- a/app/locales/vi.ts +++ b/app/locales/vi.ts @@ -71,6 +71,11 @@ const vi: PartialLocaleType = { Title: "Font chữ", SubTitle: "Thay đổi font chữ của nội dung trò chuyện", }, + InjectSystemPrompts: { + Title: "Tiêm Prompt Hệ thống", + SubTitle: + "Bắt buộc thêm một prompt hệ thống giả lập ChatGPT ở đầu danh sách tin nhắn cho mỗi yêu cầu", + }, Update: { Version: (x: string) => `Phiên bản: ${x}`, IsLatest: "Phiên bản mới nhất",