2024-07-26 16:00:25 +08:00
|
|
|
export const OWNER = "ChatGPTNextWeb";
|
2023-03-24 01:00:33 +08:00
|
|
|
export const REPO = "ChatGPT-Next-Web";
|
|
|
|
export const REPO_URL = `https://github.com/${OWNER}/${REPO}`;
|
2024-09-06 19:37:24 +08:00
|
|
|
export const PLUGINS_REPO_URL = `https://github.com/${OWNER}/NextChat-Awesome-Plugins`;
|
2023-04-03 13:29:37 +08:00
|
|
|
export const ISSUE_URL = `https://github.com/${OWNER}/${REPO}/issues`;
|
2023-04-06 00:41:44 +08:00
|
|
|
export const UPDATE_URL = `${REPO_URL}#keep-updated`;
|
2023-06-30 00:26:03 +08:00
|
|
|
export const RELEASE_URL = `${REPO_URL}/releases`;
|
2023-03-24 01:00:33 +08:00
|
|
|
export const FETCH_COMMIT_URL = `https://api.github.com/repos/${OWNER}/${REPO}/commits?per_page=1`;
|
2023-03-31 00:46:17 +08:00
|
|
|
export const FETCH_TAG_URL = `https://api.github.com/repos/${OWNER}/${REPO}/tags?per_page=1`;
|
2023-04-11 01:21:34 +08:00
|
|
|
export const RUNTIME_CONFIG_DOM = "danger-runtime-config";
|
2023-09-13 02:51:02 +08:00
|
|
|
|
2024-07-11 15:29:47 +08:00
|
|
|
export const STABILITY_BASE_URL = "https://api.stability.ai";
|
|
|
|
|
2024-02-07 13:17:11 +08:00
|
|
|
export const DEFAULT_API_HOST = "https://api.nextchat.dev";
|
2023-11-08 00:20:34 +08:00
|
|
|
export const OPENAI_BASE_URL = "https://api.openai.com";
|
2024-04-07 11:32:57 +08:00
|
|
|
export const ANTHROPIC_BASE_URL = "https://api.anthropic.com";
|
2023-04-21 01:12:39 +08:00
|
|
|
|
2023-12-24 02:15:30 +08:00
|
|
|
export const GEMINI_BASE_URL = "https://generativelanguage.googleapis.com/";
|
|
|
|
|
2024-07-06 13:05:09 +08:00
|
|
|
export const BAIDU_BASE_URL = "https://aip.baidubce.com";
|
|
|
|
export const BAIDU_OATUH_URL = `${BAIDU_BASE_URL}/oauth/2.0/token`;
|
|
|
|
|
2024-07-06 14:59:37 +08:00
|
|
|
export const BYTEDANCE_BASE_URL = "https://ark.cn-beijing.volces.com";
|
|
|
|
|
2024-07-09 19:56:52 +08:00
|
|
|
export const ALIBABA_BASE_URL = "https://dashscope.aliyuncs.com/api/";
|
2024-07-07 21:59:56 +08:00
|
|
|
|
2024-07-07 14:43:28 +08:00
|
|
|
export const TENCENT_BASE_URL = "https://hunyuan.tencentcloudapi.com";
|
|
|
|
|
2024-08-01 11:55:22 +08:00
|
|
|
export const MOONSHOT_BASE_URL = "https://api.moonshot.cn";
|
2024-08-03 17:20:26 +08:00
|
|
|
export const IFLYTEK_BASE_URL = "https://spark-api-open.xf-yun.com";
|
2024-07-07 21:59:56 +08:00
|
|
|
|
2024-07-19 13:50:10 +08:00
|
|
|
export const CACHE_URL_PREFIX = "/api/cache";
|
|
|
|
export const UPLOAD_URL = `${CACHE_URL_PREFIX}/upload`;
|
|
|
|
|
2023-04-21 01:12:39 +08:00
|
|
|
export enum Path {
|
|
|
|
Home = "/",
|
|
|
|
Chat = "/chat",
|
|
|
|
Settings = "/settings",
|
2023-04-24 01:15:44 +08:00
|
|
|
NewChat = "/new-chat",
|
2023-04-25 00:49:27 +08:00
|
|
|
Masks = "/masks",
|
2024-08-30 13:02:03 +08:00
|
|
|
Plugins = "/plugins",
|
2023-06-07 02:18:24 +08:00
|
|
|
Auth = "/auth",
|
2024-06-27 16:06:15 +08:00
|
|
|
Sd = "/sd",
|
2024-07-23 20:24:56 +08:00
|
|
|
SdNew = "/sd-new",
|
2024-07-26 15:50:26 +08:00
|
|
|
Artifacts = "/artifacts",
|
2024-08-14 22:28:05 +08:00
|
|
|
SearchChat = "/search-chat",
|
2023-04-24 01:15:44 +08:00
|
|
|
}
|
|
|
|
|
2023-09-13 02:51:02 +08:00
|
|
|
export enum ApiPath {
|
2024-03-14 01:33:41 +08:00
|
|
|
Cors = "",
|
2024-07-05 19:59:45 +08:00
|
|
|
Azure = "/api/azure",
|
2023-11-10 02:43:30 +08:00
|
|
|
OpenAI = "/api/openai",
|
2023-11-07 23:22:11 +08:00
|
|
|
Anthropic = "/api/anthropic",
|
2024-07-12 21:27:30 +08:00
|
|
|
Google = "/api/google",
|
2024-07-06 13:05:09 +08:00
|
|
|
Baidu = "/api/baidu",
|
2024-07-06 14:59:37 +08:00
|
|
|
ByteDance = "/api/bytedance",
|
2024-07-07 21:59:56 +08:00
|
|
|
Alibaba = "/api/alibaba",
|
2024-07-07 14:43:28 +08:00
|
|
|
Tencent = "/api/tencent",
|
2024-08-01 11:55:22 +08:00
|
|
|
Moonshot = "/api/moonshot",
|
2024-08-03 17:20:26 +08:00
|
|
|
Iflytek = "/api/iflytek",
|
2024-07-25 12:31:30 +08:00
|
|
|
Stability = "/api/stability",
|
2024-07-26 15:50:26 +08:00
|
|
|
Artifacts = "/api/artifacts",
|
2023-09-13 02:51:02 +08:00
|
|
|
}
|
|
|
|
|
2023-04-24 01:15:44 +08:00
|
|
|
export enum SlotID {
|
|
|
|
AppBody = "app-body",
|
2023-11-10 02:43:30 +08:00
|
|
|
CustomModel = "custom-model",
|
2023-04-21 01:12:39 +08:00
|
|
|
}
|
2023-04-21 02:52:53 +08:00
|
|
|
|
2023-04-27 01:16:21 +08:00
|
|
|
export enum FileName {
|
|
|
|
Masks = "masks.json",
|
|
|
|
Prompts = "prompts.json",
|
|
|
|
}
|
|
|
|
|
2023-04-27 02:00:22 +08:00
|
|
|
export enum StoreKey {
|
|
|
|
Chat = "chat-next-web-store",
|
2024-08-29 19:55:09 +08:00
|
|
|
Plugin = "chat-next-web-plugin",
|
2023-04-27 02:00:22 +08:00
|
|
|
Access = "access-control",
|
|
|
|
Config = "app-config",
|
|
|
|
Mask = "mask-store",
|
|
|
|
Prompt = "prompt-store",
|
|
|
|
Update = "chat-update",
|
2023-06-28 00:34:01 +08:00
|
|
|
Sync = "sync",
|
2024-07-03 15:37:34 +08:00
|
|
|
SdList = "sd-list",
|
2023-04-27 02:00:22 +08:00
|
|
|
}
|
|
|
|
|
2023-09-19 01:47:15 +08:00
|
|
|
export const DEFAULT_SIDEBAR_WIDTH = 300;
|
2023-04-21 02:52:53 +08:00
|
|
|
export const MAX_SIDEBAR_WIDTH = 500;
|
|
|
|
export const MIN_SIDEBAR_WIDTH = 230;
|
|
|
|
export const NARROW_SIDEBAR_WIDTH = 100;
|
2023-05-04 22:50:07 +08:00
|
|
|
|
2023-08-09 15:27:08 +08:00
|
|
|
export const ACCESS_CODE_PREFIX = "nk-";
|
2023-05-09 23:01:17 +08:00
|
|
|
|
|
|
|
export const LAST_INPUT_KEY = "last-input";
|
2023-09-05 01:54:28 +08:00
|
|
|
export const UNFINISHED_INPUT = (id: string) => "unfinished-input-" + id;
|
2023-05-14 23:00:17 +08:00
|
|
|
|
2023-09-13 02:51:02 +08:00
|
|
|
export const STORAGE_KEY = "chatgpt-next-web";
|
|
|
|
|
2023-05-14 23:00:17 +08:00
|
|
|
export const REQUEST_TIMEOUT_MS = 60000;
|
2023-05-25 01:04:37 +08:00
|
|
|
|
|
|
|
export const EXPORT_MESSAGE_CLASS_NAME = "export-markdown";
|
2023-06-13 00:39:29 +08:00
|
|
|
|
2023-11-10 02:43:30 +08:00
|
|
|
export enum ServiceProvider {
|
|
|
|
OpenAI = "OpenAI",
|
|
|
|
Azure = "Azure",
|
2023-12-24 02:15:30 +08:00
|
|
|
Google = "Google",
|
2024-04-07 11:32:57 +08:00
|
|
|
Anthropic = "Anthropic",
|
2024-07-06 13:05:09 +08:00
|
|
|
Baidu = "Baidu",
|
2024-07-06 14:59:37 +08:00
|
|
|
ByteDance = "ByteDance",
|
2024-07-07 21:59:56 +08:00
|
|
|
Alibaba = "Alibaba",
|
2024-07-07 14:43:28 +08:00
|
|
|
Tencent = "Tencent",
|
2024-08-01 11:55:22 +08:00
|
|
|
Moonshot = "Moonshot",
|
2024-07-24 20:04:22 +08:00
|
|
|
Stability = "Stability",
|
2024-08-03 17:20:26 +08:00
|
|
|
Iflytek = "Iflytek",
|
2023-12-24 02:15:30 +08:00
|
|
|
}
|
|
|
|
|
2024-06-15 12:09:58 +08:00
|
|
|
// Google API safety settings, see https://ai.google.dev/gemini-api/docs/safety-settings
|
|
|
|
// BLOCK_NONE will not block any content, and BLOCK_ONLY_HIGH will block only high-risk content.
|
|
|
|
export enum GoogleSafetySettingsThreshold {
|
|
|
|
BLOCK_NONE = "BLOCK_NONE",
|
|
|
|
BLOCK_ONLY_HIGH = "BLOCK_ONLY_HIGH",
|
|
|
|
BLOCK_MEDIUM_AND_ABOVE = "BLOCK_MEDIUM_AND_ABOVE",
|
|
|
|
BLOCK_LOW_AND_ABOVE = "BLOCK_LOW_AND_ABOVE",
|
|
|
|
}
|
|
|
|
|
2023-12-24 02:15:30 +08:00
|
|
|
export enum ModelProvider {
|
2024-07-11 15:29:47 +08:00
|
|
|
Stability = "Stability",
|
2023-12-24 02:15:30 +08:00
|
|
|
GPT = "GPT",
|
2023-12-24 04:22:12 +08:00
|
|
|
GeminiPro = "GeminiPro",
|
2024-04-07 11:32:57 +08:00
|
|
|
Claude = "Claude",
|
2024-07-06 13:05:09 +08:00
|
|
|
Ernie = "Ernie",
|
2024-07-06 14:59:37 +08:00
|
|
|
Doubao = "Doubao",
|
2024-07-07 21:59:56 +08:00
|
|
|
Qwen = "Qwen",
|
2024-07-07 14:43:28 +08:00
|
|
|
Hunyuan = "Hunyuan",
|
2024-08-01 11:55:22 +08:00
|
|
|
Moonshot = "Moonshot",
|
2024-08-03 17:20:26 +08:00
|
|
|
Iflytek = "Iflytek",
|
2023-11-10 02:43:30 +08:00
|
|
|
}
|
|
|
|
|
2024-07-23 22:44:09 +08:00
|
|
|
export const Stability = {
|
2024-07-11 15:29:47 +08:00
|
|
|
GeneratePath: "v2beta/stable-image/generate",
|
2024-07-23 22:44:09 +08:00
|
|
|
ExampleEndpoint: "https://api.stability.ai",
|
2024-07-11 15:29:47 +08:00
|
|
|
};
|
|
|
|
|
2024-04-07 11:32:57 +08:00
|
|
|
export const Anthropic = {
|
|
|
|
ChatPath: "v1/messages",
|
|
|
|
ChatPath1: "v1/complete",
|
|
|
|
ExampleEndpoint: "https://api.anthropic.com",
|
|
|
|
Vision: "2023-06-01",
|
|
|
|
};
|
|
|
|
|
2023-06-13 00:39:29 +08:00
|
|
|
export const OpenaiPath = {
|
|
|
|
ChatPath: "v1/chat/completions",
|
2024-08-27 16:21:02 +08:00
|
|
|
SpeechPath: "v1/audio/speech",
|
2024-08-02 18:00:42 +08:00
|
|
|
ImagePath: "v1/images/generations",
|
2023-06-13 00:39:29 +08:00
|
|
|
UsagePath: "dashboard/billing/usage",
|
|
|
|
SubsPath: "dashboard/billing/subscription",
|
2023-07-04 23:16:24 +08:00
|
|
|
ListModelPath: "v1/models",
|
2023-06-13 00:39:29 +08:00
|
|
|
};
|
2023-06-24 00:07:46 +08:00
|
|
|
|
2023-11-10 02:43:30 +08:00
|
|
|
export const Azure = {
|
2024-07-05 19:59:45 +08:00
|
|
|
ChatPath: (deployName: string, apiVersion: string) =>
|
|
|
|
`deployments/${deployName}/chat/completions?api-version=${apiVersion}`,
|
2024-08-02 18:00:42 +08:00
|
|
|
// https://<your_resource_name>.openai.azure.com/openai/deployments/<your_deployment_name>/images/generations?api-version=<api_version>
|
|
|
|
ImagePath: (deployName: string, apiVersion: string) =>
|
|
|
|
`deployments/${deployName}/images/generations?api-version=${apiVersion}`,
|
|
|
|
ExampleEndpoint: "https://{resource-url}/openai",
|
2023-11-10 02:43:30 +08:00
|
|
|
};
|
|
|
|
|
2023-12-24 02:15:30 +08:00
|
|
|
export const Google = {
|
2023-12-31 18:02:04 +08:00
|
|
|
ExampleEndpoint: "https://generativelanguage.googleapis.com/",
|
2024-07-17 20:05:34 +08:00
|
|
|
ChatPath: (modelName: string) =>
|
|
|
|
`v1beta/models/${modelName}:streamGenerateContent`,
|
2023-12-24 02:15:30 +08:00
|
|
|
};
|
|
|
|
|
2024-07-06 13:05:09 +08:00
|
|
|
export const Baidu = {
|
2024-07-09 12:27:44 +08:00
|
|
|
ExampleEndpoint: BAIDU_BASE_URL,
|
|
|
|
ChatPath: (modelName: string) => {
|
|
|
|
let endpoint = modelName;
|
|
|
|
if (modelName === "ernie-4.0-8k") {
|
|
|
|
endpoint = "completions_pro";
|
|
|
|
}
|
|
|
|
if (modelName === "ernie-4.0-8k-preview-0518") {
|
|
|
|
endpoint = "completions_adv_pro";
|
|
|
|
}
|
|
|
|
if (modelName === "ernie-3.5-8k") {
|
|
|
|
endpoint = "completions";
|
|
|
|
}
|
2024-07-17 17:29:43 +08:00
|
|
|
if (modelName === "ernie-speed-8k") {
|
2024-07-17 16:54:53 +08:00
|
|
|
endpoint = "ernie_speed";
|
|
|
|
}
|
2024-07-09 14:50:40 +08:00
|
|
|
return `rpc/2.0/ai_custom/v1/wenxinworkshop/chat/${endpoint}`;
|
2024-07-09 12:27:44 +08:00
|
|
|
},
|
2024-07-06 13:05:09 +08:00
|
|
|
};
|
|
|
|
|
2024-07-06 14:59:37 +08:00
|
|
|
export const ByteDance = {
|
2024-07-09 16:53:15 +08:00
|
|
|
ExampleEndpoint: "https://ark.cn-beijing.volces.com/api/",
|
|
|
|
ChatPath: "api/v3/chat/completions",
|
2024-07-06 14:59:37 +08:00
|
|
|
};
|
|
|
|
|
2024-07-07 21:59:56 +08:00
|
|
|
export const Alibaba = {
|
2024-07-09 19:56:52 +08:00
|
|
|
ExampleEndpoint: ALIBABA_BASE_URL,
|
|
|
|
ChatPath: "v1/services/aigc/text-generation/generation",
|
2024-07-07 21:59:56 +08:00
|
|
|
};
|
|
|
|
|
2024-07-07 14:43:28 +08:00
|
|
|
export const Tencent = {
|
2024-08-01 15:39:54 +08:00
|
|
|
ExampleEndpoint: TENCENT_BASE_URL,
|
|
|
|
};
|
|
|
|
|
2024-08-01 11:55:22 +08:00
|
|
|
export const Moonshot = {
|
|
|
|
ExampleEndpoint: MOONSHOT_BASE_URL,
|
|
|
|
ChatPath: "v1/chat/completions",
|
2024-07-07 14:43:28 +08:00
|
|
|
};
|
|
|
|
|
2024-08-03 17:20:26 +08:00
|
|
|
export const Iflytek = {
|
|
|
|
ExampleEndpoint: IFLYTEK_BASE_URL,
|
|
|
|
ChatPath: "v1/chat/completions",
|
|
|
|
};
|
|
|
|
|
2023-06-24 16:50:05 +08:00
|
|
|
export const DEFAULT_INPUT_TEMPLATE = `{{input}}`; // input / time / model / lang
|
2024-04-08 19:27:22 +08:00
|
|
|
// export const DEFAULT_SYSTEM_TEMPLATE = `
|
|
|
|
// You are ChatGPT, a large language model trained by {{ServiceProvider}}.
|
|
|
|
// Knowledge cutoff: {{cutoff}}
|
|
|
|
// Current model: {{model}}
|
|
|
|
// Current time: {{time}}
|
|
|
|
// Latex inline: $x^2$
|
|
|
|
// Latex block: $$e=mc^2$$
|
|
|
|
// `;
|
2023-06-26 13:18:59 +08:00
|
|
|
export const DEFAULT_SYSTEM_TEMPLATE = `
|
2024-02-05 13:35:51 +08:00
|
|
|
You are ChatGPT, a large language model trained by {{ServiceProvider}}.
|
2023-11-07 23:54:30 +08:00
|
|
|
Knowledge cutoff: {{cutoff}}
|
2023-06-26 13:18:59 +08:00
|
|
|
Current model: {{model}}
|
2023-11-07 07:42:55 +08:00
|
|
|
Current time: {{time}}
|
2024-04-09 10:45:09 +08:00
|
|
|
Latex inline: \\(x^2\\)
|
2023-11-12 19:33:19 +08:00
|
|
|
Latex block: $$e=mc^2$$
|
2023-11-07 07:42:55 +08:00
|
|
|
`;
|
2023-07-04 23:16:24 +08:00
|
|
|
|
2024-07-19 23:36:57 +08:00
|
|
|
export const SUMMARIZE_MODEL = "gpt-4o-mini";
|
2024-02-20 18:04:32 +08:00
|
|
|
export const GEMINI_SUMMARIZE_MODEL = "gemini-pro";
|
2023-08-28 00:02:52 +08:00
|
|
|
|
2023-11-07 23:54:30 +08:00
|
|
|
export const KnowledgeCutOffDate: Record<string, string> = {
|
|
|
|
default: "2021-09",
|
2024-04-10 17:18:39 +08:00
|
|
|
"gpt-4-turbo": "2023-12",
|
2024-04-12 22:44:26 +08:00
|
|
|
"gpt-4-turbo-2024-04-09": "2023-12",
|
2024-02-27 10:28:54 +08:00
|
|
|
"gpt-4-turbo-preview": "2023-12",
|
2024-05-14 05:28:13 +08:00
|
|
|
"gpt-4o": "2023-10",
|
|
|
|
"gpt-4o-2024-05-13": "2023-10",
|
2024-08-08 16:23:40 +08:00
|
|
|
"gpt-4o-2024-08-06": "2023-10",
|
2024-09-07 01:42:56 +08:00
|
|
|
"chatgpt-4o-latest": "2023-10",
|
2024-07-19 01:54:40 +08:00
|
|
|
"gpt-4o-mini": "2023-10",
|
|
|
|
"gpt-4o-mini-2024-07-18": "2023-10",
|
2023-11-07 23:54:30 +08:00
|
|
|
"gpt-4-vision-preview": "2023-04",
|
2024-09-13 13:18:07 +08:00
|
|
|
"o1-mini": "2023-10",
|
|
|
|
"o1-preview": "2023-10",
|
2024-02-07 13:17:11 +08:00
|
|
|
// After improvements,
|
2024-02-05 14:44:46 +08:00
|
|
|
// it's now easier to add "KnowledgeCutOffDate" instead of stupid hardcoding it, as was done previously.
|
|
|
|
"gemini-pro": "2023-12",
|
2024-03-28 15:51:06 +08:00
|
|
|
"gemini-pro-vision": "2023-12",
|
2023-11-07 23:54:30 +08:00
|
|
|
};
|
|
|
|
|
2024-08-27 16:21:02 +08:00
|
|
|
export const DEFAULT_TTS_ENGINE = "OpenAI-TTS";
|
|
|
|
export const DEFAULT_TTS_ENGINES = ["OpenAI-TTS", "Edge-TTS"];
|
|
|
|
export const DEFAULT_TTS_MODEL = "tts-1";
|
|
|
|
export const DEFAULT_TTS_VOICE = "alloy";
|
|
|
|
export const DEFAULT_TTS_MODELS = ["tts-1", "tts-1-hd"];
|
|
|
|
export const DEFAULT_TTS_VOICES = [
|
|
|
|
"alloy",
|
|
|
|
"echo",
|
|
|
|
"fable",
|
|
|
|
"onyx",
|
|
|
|
"nova",
|
|
|
|
"shimmer",
|
|
|
|
];
|
|
|
|
|
2024-04-15 18:14:14 +08:00
|
|
|
const openaiModels = [
|
|
|
|
"gpt-3.5-turbo",
|
|
|
|
"gpt-3.5-turbo-1106",
|
|
|
|
"gpt-3.5-turbo-0125",
|
|
|
|
"gpt-4",
|
|
|
|
"gpt-4-0613",
|
|
|
|
"gpt-4-32k",
|
|
|
|
"gpt-4-32k-0613",
|
|
|
|
"gpt-4-turbo",
|
|
|
|
"gpt-4-turbo-preview",
|
2024-05-14 05:28:13 +08:00
|
|
|
"gpt-4o",
|
|
|
|
"gpt-4o-2024-05-13",
|
2024-08-08 16:23:40 +08:00
|
|
|
"gpt-4o-2024-08-06",
|
2024-09-07 01:42:56 +08:00
|
|
|
"chatgpt-4o-latest",
|
2024-07-19 01:54:40 +08:00
|
|
|
"gpt-4o-mini",
|
|
|
|
"gpt-4o-mini-2024-07-18",
|
2024-04-15 18:14:14 +08:00
|
|
|
"gpt-4-vision-preview",
|
2024-06-07 03:28:00 +08:00
|
|
|
"gpt-4-turbo-2024-04-09",
|
2024-07-05 23:56:10 +08:00
|
|
|
"gpt-4-1106-preview",
|
2024-08-02 18:00:42 +08:00
|
|
|
"dall-e-3",
|
2024-09-13 13:18:07 +08:00
|
|
|
"o1-mini",
|
2024-09-18 10:39:56 +08:00
|
|
|
"o1-preview",
|
2024-04-15 18:14:14 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
const googleModels = [
|
|
|
|
"gemini-1.0-pro",
|
|
|
|
"gemini-1.5-pro-latest",
|
2024-05-15 15:29:38 +08:00
|
|
|
"gemini-1.5-flash-latest",
|
2024-04-15 18:14:14 +08:00
|
|
|
"gemini-pro-vision",
|
|
|
|
];
|
|
|
|
|
|
|
|
const anthropicModels = [
|
|
|
|
"claude-instant-1.2",
|
|
|
|
"claude-2.0",
|
|
|
|
"claude-2.1",
|
|
|
|
"claude-3-sonnet-20240229",
|
|
|
|
"claude-3-opus-20240229",
|
|
|
|
"claude-3-haiku-20240307",
|
2024-06-21 18:05:28 +08:00
|
|
|
"claude-3-5-sonnet-20240620",
|
2024-04-15 18:14:14 +08:00
|
|
|
];
|
|
|
|
|
2024-07-06 13:05:09 +08:00
|
|
|
const baiduModels = [
|
|
|
|
"ernie-4.0-turbo-8k",
|
2024-07-09 12:27:44 +08:00
|
|
|
"ernie-4.0-8k",
|
2024-07-06 13:05:09 +08:00
|
|
|
"ernie-4.0-8k-preview",
|
2024-07-09 12:27:44 +08:00
|
|
|
"ernie-4.0-8k-preview-0518",
|
2024-07-06 13:05:09 +08:00
|
|
|
"ernie-4.0-8k-latest",
|
2024-07-09 12:27:44 +08:00
|
|
|
"ernie-3.5-8k",
|
2024-07-06 13:05:09 +08:00
|
|
|
"ernie-3.5-8k-0205",
|
2024-07-17 17:29:43 +08:00
|
|
|
"ernie-speed-128k",
|
2024-07-17 18:41:31 +08:00
|
|
|
"ernie-speed-8k",
|
|
|
|
"ernie-lite-8k",
|
2024-07-19 13:50:10 +08:00
|
|
|
"ernie-tiny-8k",
|
2024-07-06 13:05:09 +08:00
|
|
|
];
|
|
|
|
|
2024-07-06 22:59:20 +08:00
|
|
|
const bytedanceModels = [
|
|
|
|
"Doubao-lite-4k",
|
|
|
|
"Doubao-lite-32k",
|
|
|
|
"Doubao-lite-128k",
|
|
|
|
"Doubao-pro-4k",
|
|
|
|
"Doubao-pro-32k",
|
|
|
|
"Doubao-pro-128k",
|
|
|
|
];
|
2024-07-06 14:59:37 +08:00
|
|
|
|
2024-07-07 21:59:56 +08:00
|
|
|
const alibabaModes = [
|
|
|
|
"qwen-turbo",
|
|
|
|
"qwen-plus",
|
|
|
|
"qwen-max",
|
|
|
|
"qwen-max-0428",
|
|
|
|
"qwen-max-0403",
|
|
|
|
"qwen-max-0107",
|
|
|
|
"qwen-max-longcontext",
|
2024-04-15 18:14:14 +08:00
|
|
|
];
|
|
|
|
|
2024-07-07 14:43:28 +08:00
|
|
|
const tencentModels = [
|
|
|
|
"hunyuan-pro",
|
|
|
|
"hunyuan-standard",
|
|
|
|
"hunyuan-lite",
|
|
|
|
"hunyuan-role",
|
|
|
|
"hunyuan-functioncall",
|
|
|
|
"hunyuan-code",
|
|
|
|
"hunyuan-vision",
|
|
|
|
];
|
|
|
|
|
2024-08-01 11:55:22 +08:00
|
|
|
const moonshotModes = ["moonshot-v1-8k", "moonshot-v1-32k", "moonshot-v1-128k"];
|
|
|
|
|
2024-08-03 17:20:26 +08:00
|
|
|
const iflytekModels = [
|
|
|
|
"general",
|
|
|
|
"generalv3",
|
|
|
|
"pro-128k",
|
|
|
|
"generalv3.5",
|
|
|
|
"4.0Ultra",
|
|
|
|
];
|
|
|
|
|
2024-08-05 19:43:32 +08:00
|
|
|
let seq = 1000; // 内置的模型序号生成器从1000开始
|
2023-07-04 23:16:24 +08:00
|
|
|
export const DEFAULT_MODELS = [
|
2024-04-15 18:14:14 +08:00
|
|
|
...openaiModels.map((name) => ({
|
|
|
|
name,
|
2024-01-26 15:00:02 +08:00
|
|
|
available: true,
|
2024-08-05 19:43:32 +08:00
|
|
|
sorted: seq++, // Global sequence sort(index)
|
2024-01-26 15:00:02 +08:00
|
|
|
provider: {
|
|
|
|
id: "openai",
|
|
|
|
providerName: "OpenAI",
|
|
|
|
providerType: "openai",
|
2024-08-05 19:43:32 +08:00
|
|
|
sorted: 1, // 这里是固定的,确保顺序与之前内置的版本一致
|
2024-01-26 15:00:02 +08:00
|
|
|
},
|
2024-04-15 18:14:14 +08:00
|
|
|
})),
|
2024-07-05 19:59:45 +08:00
|
|
|
...openaiModels.map((name) => ({
|
|
|
|
name,
|
|
|
|
available: true,
|
2024-08-05 19:43:32 +08:00
|
|
|
sorted: seq++,
|
2024-07-05 19:59:45 +08:00
|
|
|
provider: {
|
|
|
|
id: "azure",
|
|
|
|
providerName: "Azure",
|
|
|
|
providerType: "azure",
|
2024-08-05 19:43:32 +08:00
|
|
|
sorted: 2,
|
2024-07-05 19:59:45 +08:00
|
|
|
},
|
|
|
|
})),
|
2024-04-15 18:14:14 +08:00
|
|
|
...googleModels.map((name) => ({
|
|
|
|
name,
|
2023-12-24 02:15:30 +08:00
|
|
|
available: true,
|
2024-08-05 19:43:32 +08:00
|
|
|
sorted: seq++,
|
2023-12-24 02:15:30 +08:00
|
|
|
provider: {
|
|
|
|
id: "google",
|
|
|
|
providerName: "Google",
|
|
|
|
providerType: "google",
|
2024-08-05 19:43:32 +08:00
|
|
|
sorted: 3,
|
2023-12-24 02:15:30 +08:00
|
|
|
},
|
2024-04-15 18:14:14 +08:00
|
|
|
})),
|
|
|
|
...anthropicModels.map((name) => ({
|
|
|
|
name,
|
2024-02-20 18:04:32 +08:00
|
|
|
available: true,
|
2024-08-05 19:43:32 +08:00
|
|
|
sorted: seq++,
|
2024-02-20 18:04:32 +08:00
|
|
|
provider: {
|
2024-04-07 11:32:57 +08:00
|
|
|
id: "anthropic",
|
|
|
|
providerName: "Anthropic",
|
|
|
|
providerType: "anthropic",
|
2024-08-05 19:43:32 +08:00
|
|
|
sorted: 4,
|
2024-02-20 18:04:32 +08:00
|
|
|
},
|
2024-04-15 18:14:14 +08:00
|
|
|
})),
|
2024-07-06 13:05:09 +08:00
|
|
|
...baiduModels.map((name) => ({
|
|
|
|
name,
|
|
|
|
available: true,
|
2024-08-05 19:43:32 +08:00
|
|
|
sorted: seq++,
|
2024-07-06 13:05:09 +08:00
|
|
|
provider: {
|
|
|
|
id: "baidu",
|
|
|
|
providerName: "Baidu",
|
|
|
|
providerType: "baidu",
|
2024-08-05 19:43:32 +08:00
|
|
|
sorted: 5,
|
2024-07-06 13:05:09 +08:00
|
|
|
},
|
|
|
|
})),
|
2024-07-06 14:59:37 +08:00
|
|
|
...bytedanceModels.map((name) => ({
|
|
|
|
name,
|
|
|
|
available: true,
|
2024-08-05 19:43:32 +08:00
|
|
|
sorted: seq++,
|
2024-07-06 14:59:37 +08:00
|
|
|
provider: {
|
|
|
|
id: "bytedance",
|
|
|
|
providerName: "ByteDance",
|
|
|
|
providerType: "bytedance",
|
2024-08-05 19:43:32 +08:00
|
|
|
sorted: 6,
|
2024-07-06 14:59:37 +08:00
|
|
|
},
|
|
|
|
})),
|
2024-07-07 21:59:56 +08:00
|
|
|
...alibabaModes.map((name) => ({
|
|
|
|
name,
|
|
|
|
available: true,
|
2024-08-05 19:43:32 +08:00
|
|
|
sorted: seq++,
|
2024-07-07 21:59:56 +08:00
|
|
|
provider: {
|
|
|
|
id: "alibaba",
|
|
|
|
providerName: "Alibaba",
|
|
|
|
providerType: "alibaba",
|
2024-08-05 19:43:32 +08:00
|
|
|
sorted: 7,
|
2024-07-07 21:59:56 +08:00
|
|
|
},
|
|
|
|
})),
|
2024-07-07 14:43:28 +08:00
|
|
|
...tencentModels.map((name) => ({
|
|
|
|
name,
|
|
|
|
available: true,
|
2024-08-05 19:43:32 +08:00
|
|
|
sorted: seq++,
|
2024-07-07 14:43:28 +08:00
|
|
|
provider: {
|
|
|
|
id: "tencent",
|
|
|
|
providerName: "Tencent",
|
|
|
|
providerType: "tencent",
|
2024-08-05 19:43:32 +08:00
|
|
|
sorted: 8,
|
2024-07-07 14:43:28 +08:00
|
|
|
},
|
|
|
|
})),
|
2024-08-01 11:55:22 +08:00
|
|
|
...moonshotModes.map((name) => ({
|
|
|
|
name,
|
|
|
|
available: true,
|
2024-08-05 19:43:32 +08:00
|
|
|
sorted: seq++,
|
2024-08-01 11:55:22 +08:00
|
|
|
provider: {
|
|
|
|
id: "moonshot",
|
|
|
|
providerName: "Moonshot",
|
|
|
|
providerType: "moonshot",
|
2024-08-05 19:43:32 +08:00
|
|
|
sorted: 9,
|
2024-08-01 11:55:22 +08:00
|
|
|
},
|
|
|
|
})),
|
2024-08-03 17:20:26 +08:00
|
|
|
...iflytekModels.map((name) => ({
|
|
|
|
name,
|
|
|
|
available: true,
|
|
|
|
sorted: seq++,
|
|
|
|
provider: {
|
|
|
|
id: "iflytek",
|
|
|
|
providerName: "Iflytek",
|
|
|
|
providerType: "iflytek",
|
|
|
|
sorted: 10,
|
|
|
|
},
|
|
|
|
})),
|
2023-07-04 23:16:24 +08:00
|
|
|
] as const;
|
2023-08-04 02:16:44 +08:00
|
|
|
|
2023-08-04 19:24:10 +08:00
|
|
|
export const CHAT_PAGE_SIZE = 15;
|
|
|
|
export const MAX_RENDER_MSG_COUNT = 45;
|
2024-04-09 18:05:56 +08:00
|
|
|
|
2024-04-09 20:49:51 +08:00
|
|
|
// some famous webdav endpoints
|
2024-05-06 19:26:39 +08:00
|
|
|
export const internalAllowedWebDavEndpoints = [
|
2024-04-09 20:49:51 +08:00
|
|
|
"https://dav.jianguoyun.com/dav/",
|
|
|
|
"https://dav.dropdav.com/",
|
|
|
|
"https://dav.box.com/dav",
|
|
|
|
"https://nanao.teracloud.jp/dav/",
|
2024-06-07 03:28:00 +08:00
|
|
|
"https://bora.teracloud.jp/dav/",
|
2024-04-09 20:49:51 +08:00
|
|
|
"https://webdav.4shared.com/",
|
|
|
|
"https://dav.idrivesync.com",
|
|
|
|
"https://webdav.yandex.com",
|
|
|
|
"https://app.koofr.net/dav/Koofr",
|
|
|
|
];
|
2024-06-27 16:06:15 +08:00
|
|
|
|
2024-08-16 16:10:31 +08:00
|
|
|
export const DEFAULT_GA_ID = "G-89WN60ZK2E";
|
2024-08-20 19:44:22 +08:00
|
|
|
export const PLUGINS = [
|
2024-08-30 13:02:03 +08:00
|
|
|
{ name: "Plugins", path: Path.Plugins },
|
2024-08-20 19:44:22 +08:00
|
|
|
{ name: "Stable Diffusion", path: Path.Sd },
|
|
|
|
{ name: "Search Chat", path: Path.SearchChat },
|
|
|
|
];
|