From ad5093ce0593e21df3e7c782a0396725662a425a Mon Sep 17 00:00:00 2001 From: KeithHello Date: Wed, 4 Oct 2023 16:38:28 +0900 Subject: [PATCH] Change log - config.ts - line 72 remove type confirmation of x as x always has type 'number' - line 135 remove redundant local variable - chat.ts - delete unused import --- app/locales/index.ts | 2 +- app/store/chat.ts | 3 --- app/store/config.ts | 10 ++++------ 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/app/locales/index.ts b/app/locales/index.ts index 79e314fa..a32d3207 100644 --- a/app/locales/index.ts +++ b/app/locales/index.ts @@ -65,7 +65,7 @@ export const ALL_LANG_OPTIONS: Record = { }; const LANG_KEY = "lang"; -const DEFAULT_LANG = "en"; +const DEFAULT_LANG = "cn"; const fallbackLang = en; const targetLang = ALL_LANGS[getLang()] as LocaleType; diff --git a/app/store/chat.ts b/app/store/chat.ts index 269cc4a3..56ac8db6 100644 --- a/app/store/chat.ts +++ b/app/store/chat.ts @@ -1,6 +1,3 @@ -import { create } from "zustand"; -import { persist } from "zustand/middleware"; - import { trimTopic } from "../utils"; import Locale, { getLang } from "../locales"; diff --git a/app/store/config.ts b/app/store/config.ts index 956e5f3e..b6488479 100644 --- a/app/store/config.ts +++ b/app/store/config.ts @@ -46,13 +46,13 @@ export const DEFAULT_CONFIG = { modelConfig: { model: "gpt-3.5-turbo" as ModelType, - temperature: 0.5, + temperature: 0.6, top_p: 1, max_tokens: 2000, presence_penalty: 0, frequency_penalty: 0, sendMemory: true, - historyMessageCount: 4, + historyMessageCount: 1, compressMessageLengthThreshold: 1000, enableInjectSystemPrompts: true, template: DEFAULT_INPUT_TEMPLATE, @@ -69,7 +69,7 @@ export function limitNumber( max: number, defaultValue: number, ) { - if (typeof x !== "number" || isNaN(x)) { + if (isNaN(x)) { return defaultValue; } @@ -132,9 +132,7 @@ export const useAppConfig = createPersistStore( .customModels.split(",") .filter((v) => !!v && v.length > 0) .map((m) => ({ name: m, available: true })); - - const models = get().models.concat(customModels); - return models; + return get().models.concat(customModels); }, }), {