From c871a587d94ff4629aed7b3638c5073e1c6f675b Mon Sep 17 00:00:00 2001 From: Ou Date: Fri, 14 Apr 2023 22:56:25 +0800 Subject: [PATCH] pref!: remove option of reset continuous dialogue --- .env.example | 3 +-- env.d.ts | 1 - src/env.ts | 1 - src/store.ts | 3 +-- 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.env.example b/.env.example index 15758e01c..c84b67bdc 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,4 @@ -CLIENT_AUTO_RESET_CONTINUOUS_DIALOGUE=false -CLIENT_DEFAULT_SETTING={"continuousDialogue":true,"archiveSession":false,"openaiAPIKey":"","openaiAPITemperature":60,"password":"","systemRule":"","model":"gpt-3.5-turbo"} +CLIENT_DEFAULT_SETTING={"continuousDialogue":true,"archiveSession":false,"APIKey":"","APITemperature":0.6,"password":"","APIModel":"gpt-3.5-turbo"} CLIENT_DEFAULT_MESSAGE='Powered by OpenAI Vercel - 如果本项目对你有所帮助,可以给小猫 [买点零食](https://cdn.jsdelivr.net/gh/ourongxing/chatgpt-vercel/assets/reward.gif),但不接受任何付费功能请求。 - 本网站仅作为项目演示,不提供服务,请填入自己的 Key,长期使用请 [自行部署](https://github.com/ourongxing/chatgpt-vercel#%E9%83%A8%E7%BD%B2%E4%B8%80%E4%B8%AA%E4%BD%A0%E8%87%AA%E5%B7%B1%E7%9A%84-chatgpt-%E7%BD%91%E7%AB%99%E5%85%8D%E8%B4%B9),简单成本低。 diff --git a/env.d.ts b/env.d.ts index 47cbff9de..2e8c0d3fd 100644 --- a/env.d.ts +++ b/env.d.ts @@ -1,5 +1,4 @@ interface ImportMetaEnv { - CLIENT_AUTO_RESET_CONTINUOUS_DIALOGUE?: string CLIENT_DEFAULT_SETTING?: string CLIENT_DEFAULT_MESSAGE?: string CLIENT_MAX_INPUT_TOKENS?: string diff --git a/src/env.ts b/src/env.ts index 030d66c68..959e0ab1d 100644 --- a/src/env.ts +++ b/src/env.ts @@ -5,7 +5,6 @@ import type { Model } from "./types" * 以 CLIENT_ 开头的变量会暴露给前端 */ export const defaultEnv = { - CLIENT_AUTO_RESET_CONTINUOUS_DIALOGUE: false, CLIENT_DEFAULT_SETTING: { continuousDialogue: true, archiveSession: false, diff --git a/src/store.ts b/src/store.ts index d0746e9e2..8fbc426b6 100644 --- a/src/store.ts +++ b/src/store.ts @@ -84,8 +84,7 @@ function Store() { ? store.messageList.filter( (k, i, _) => (k.role === "assistant" && _[i - 1]?.role === "user") || - (k.role === "user" && - (_[i + 1]?.role === "assistant" || k.type === "locked")) + (k.role === "user" && _[i + 1]?.role !== "error") ) : store.messageList.filter(k => k.type === "locked") )