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
This commit is contained in:
KeithHello 2023-10-04 16:38:28 +09:00
parent 144200e315
commit ad5093ce05
3 changed files with 5 additions and 10 deletions

View File

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

View File

@ -1,6 +1,3 @@
import { create } from "zustand";
import { persist } from "zustand/middleware";
import { trimTopic } from "../utils"; import { trimTopic } from "../utils";
import Locale, { getLang } from "../locales"; import Locale, { getLang } from "../locales";

View File

@ -46,13 +46,13 @@ export const DEFAULT_CONFIG = {
modelConfig: { modelConfig: {
model: "gpt-3.5-turbo" as ModelType, model: "gpt-3.5-turbo" as ModelType,
temperature: 0.5, temperature: 0.6,
top_p: 1, top_p: 1,
max_tokens: 2000, max_tokens: 2000,
presence_penalty: 0, presence_penalty: 0,
frequency_penalty: 0, frequency_penalty: 0,
sendMemory: true, sendMemory: true,
historyMessageCount: 4, historyMessageCount: 1,
compressMessageLengthThreshold: 1000, compressMessageLengthThreshold: 1000,
enableInjectSystemPrompts: true, enableInjectSystemPrompts: true,
template: DEFAULT_INPUT_TEMPLATE, template: DEFAULT_INPUT_TEMPLATE,
@ -69,7 +69,7 @@ export function limitNumber(
max: number, max: number,
defaultValue: number, defaultValue: number,
) { ) {
if (typeof x !== "number" || isNaN(x)) { if (isNaN(x)) {
return defaultValue; return defaultValue;
} }
@ -132,9 +132,7 @@ export const useAppConfig = createPersistStore(
.customModels.split(",") .customModels.split(",")
.filter((v) => !!v && v.length > 0) .filter((v) => !!v && v.length > 0)
.map((m) => ({ name: m, available: true })); .map((m) => ({ name: m, available: true }));
return get().models.concat(customModels);
const models = get().models.concat(customModels);
return models;
}, },
}), }),
{ {