Kaynağa Gözat

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
KeithHello 1 yıl önce
ebeveyn
işleme
ad5093ce05
3 değiştirilmiş dosya ile 5 ekleme ve 10 silme
  1. 1 1
      app/locales/index.ts
  2. 0 3
      app/store/chat.ts
  3. 4 6
      app/store/config.ts

+ 1 - 1
app/locales/index.ts

@@ -65,7 +65,7 @@ export const ALL_LANG_OPTIONS: Record<Lang, string> = {
 };
 
 const LANG_KEY = "lang";
-const DEFAULT_LANG = "en";
+const DEFAULT_LANG = "cn";
 
 const fallbackLang = en;
 const targetLang = ALL_LANGS[getLang()] as LocaleType;

+ 0 - 3
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";

+ 4 - 6
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);
     },
   }),
   {