mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-09 03:35:07 +08:00
add moonshot api
This commit is contained in:
@@ -22,6 +22,7 @@ export const BAIDU_OATUH_URL = `${BAIDU_BASE_URL}/oauth/2.0/token`;
|
||||
export const BYTEDANCE_BASE_URL = "https://ark.cn-beijing.volces.com";
|
||||
|
||||
export const ALIBABA_BASE_URL = "https://dashscope.aliyuncs.com/api/";
|
||||
export const MOONSHOT_BASE_URL = "https://api.moonshot.cn";
|
||||
|
||||
export const CACHE_URL_PREFIX = "/api/cache";
|
||||
export const UPLOAD_URL = `${CACHE_URL_PREFIX}/upload`;
|
||||
@@ -46,6 +47,7 @@ export enum ApiPath {
|
||||
Baidu = "/api/baidu",
|
||||
ByteDance = "/api/bytedance",
|
||||
Alibaba = "/api/alibaba",
|
||||
Moonshot = "/api/moonshot",
|
||||
Stability = "/api/stability",
|
||||
}
|
||||
|
||||
@@ -94,6 +96,7 @@ export enum ServiceProvider {
|
||||
Baidu = "Baidu",
|
||||
ByteDance = "ByteDance",
|
||||
Alibaba = "Alibaba",
|
||||
Moonshot = "Moonshot",
|
||||
Stability = "Stability",
|
||||
}
|
||||
|
||||
@@ -114,6 +117,7 @@ export enum ModelProvider {
|
||||
Ernie = "Ernie",
|
||||
Doubao = "Doubao",
|
||||
Qwen = "Qwen",
|
||||
Moonshot = "Moonshot",
|
||||
}
|
||||
|
||||
export const Stability = {
|
||||
@@ -177,6 +181,11 @@ export const Alibaba = {
|
||||
ChatPath: "v1/services/aigc/text-generation/generation",
|
||||
};
|
||||
|
||||
export const Moonshot = {
|
||||
ExampleEndpoint: MOONSHOT_BASE_URL,
|
||||
ChatPath: "v1/chat/completions",
|
||||
};
|
||||
|
||||
export const DEFAULT_INPUT_TEMPLATE = `{{input}}`; // input / time / model / lang
|
||||
// export const DEFAULT_SYSTEM_TEMPLATE = `
|
||||
// You are ChatGPT, a large language model trained by {{ServiceProvider}}.
|
||||
@@ -283,6 +292,8 @@ const alibabaModes = [
|
||||
"qwen-max-longcontext",
|
||||
];
|
||||
|
||||
const moonshotModes = ["moonshot-v1-8k", "moonshot-v1-32k", "moonshot-v1-128k"];
|
||||
|
||||
export const DEFAULT_MODELS = [
|
||||
...openaiModels.map((name) => ({
|
||||
name,
|
||||
@@ -347,6 +358,15 @@ export const DEFAULT_MODELS = [
|
||||
providerType: "alibaba",
|
||||
},
|
||||
})),
|
||||
...moonshotModes.map((name) => ({
|
||||
name,
|
||||
available: true,
|
||||
provider: {
|
||||
id: "moonshot",
|
||||
providerName: "Moonshot",
|
||||
providerType: "moonshot",
|
||||
},
|
||||
})),
|
||||
] as const;
|
||||
|
||||
export const CHAT_PAGE_SIZE = 15;
|
||||
|
Reference in New Issue
Block a user