From 7e9bf81ce68627e4a3ab6751430f21c897c136ea Mon Sep 17 00:00:00 2001 From: feiosme <1327979498@qq.com> Date: Sun, 28 Jan 2024 23:22:15 +0800 Subject: [PATCH] custom --- .env.template | 1 + app/constant.ts | 19 +++++++++++++++++++ app/locales/cn.ts | 3 ++- app/store/config.ts | 10 +++++----- 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/.env.template b/.env.template index 166cc4ef4e4..bbf8fdc5368 100644 --- a/.env.template +++ b/.env.template @@ -47,3 +47,4 @@ ENABLE_BALANCE_QUERY= # If you want to disable parse settings from url, set this value to 1. DISABLE_FAST_LINK= +CUSTOM_MODELS=+glm-3-turbo,+glm-4,+ERNIE-Bot=文心一言3.5,+ERNIE-Bot-turbo=文心一言3.5turbo,+ERNIE-Bot-4,+BLOOMZ-7B,+Qianfan-Chinese-Llama-2-7B,+Qianfan-Chinese-Llama-2-13B,+ChatGLM2-6B-32K,+AquilaChat-7B,+SQLCoder-7B,+CodeLlama-7B-Instruct,+XuanYuan-70B-Chat-4bit,+ChatLaw,+Yi-34B-Chat,+Mixtral-8x7B-Instruct diff --git a/app/constant.ts b/app/constant.ts index 8f251814088..3d5ec418da7 100644 --- a/app/constant.ts +++ b/app/constant.ts @@ -11,6 +11,7 @@ export const RUNTIME_CONFIG_DOM = "danger-runtime-config"; export const DEFAULT_CORS_HOST = "https://a.nextweb.fun"; export const DEFAULT_API_HOST = `${DEFAULT_CORS_HOST}/api/proxy`; export const OPENAI_BASE_URL = "https://api.openai.com"; +export const ZHIPU_BASE_URL = ""; export const GEMINI_BASE_URL = "https://generativelanguage.googleapis.com/"; @@ -114,6 +115,24 @@ export const KnowledgeCutOffDate: Record = { }; export const DEFAULT_MODELS = [ + { + name: "glm-4", + available: true, + provider: { + id: "openai", + providerName: "OpenAI", + providerType: "openai", + }, + }, + { + name: "glm-3-turbo", + available: true, + provider: { + id: "openai", + providerName: "OpenAI", + providerType: "openai", + }, + }, { name: "gpt-4", available: true, diff --git a/app/locales/cn.ts b/app/locales/cn.ts index 4a92b63833a..fb30aa32739 100644 --- a/app/locales/cn.ts +++ b/app/locales/cn.ts @@ -359,7 +359,8 @@ const cn = { }, Store: { DefaultTopic: "新的聊天", - BotHello: "有什么可以帮你的吗", + BotHello: + "有什么可以帮你的吗\nTips:所有内容都将发送到对应外部服务器,注意保密。", Error: "出错了,稍后重试吧", Prompt: { History: (content: string) => "这是历史聊天总结作为前情提要:" + content, diff --git a/app/store/config.ts b/app/store/config.ts index 20bf664df56..905350aa5fd 100644 --- a/app/store/config.ts +++ b/app/store/config.ts @@ -46,15 +46,15 @@ export const DEFAULT_CONFIG = { models: DEFAULT_MODELS as any as LLMModel[], modelConfig: { - model: "gpt-3.5-turbo" as ModelType, + model: "glm-4" as ModelType, temperature: 0.5, - top_p: 1, - max_tokens: 4000, + top_p: 0.7, + max_tokens: 32768, presence_penalty: 0, frequency_penalty: 0, sendMemory: true, - historyMessageCount: 4, - compressMessageLengthThreshold: 1000, + historyMessageCount: 8, + compressMessageLengthThreshold: 16384, enableInjectSystemPrompts: true, template: DEFAULT_INPUT_TEMPLATE, },