新增字节跳动ds模型兼容,新增华为ds模型兼容

This commit is contained in:
wangjianhua
2025-02-28 13:54:14 +08:00
parent 2167076652
commit cf9d088789
30 changed files with 896 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ import {
XAI_BASE_URL,
CHATGLM_BASE_URL,
SILICONFLOW_BASE_URL,
HUAWEI_BASE_URL,
} from "../constant";
import { getHeaders } from "../client/api";
import { getClientConfig } from "../config/client";
@@ -55,6 +56,8 @@ const DEFAULT_XAI_URL = isApp ? XAI_BASE_URL : ApiPath.XAI;
const DEFAULT_CHATGLM_URL = isApp ? CHATGLM_BASE_URL : ApiPath.ChatGLM;
const DEFAULT_HUAWEI_URL = isApp ? HUAWEI_BASE_URL : ApiPath.Huawei;
const DEFAULT_SILICONFLOW_URL = isApp
? SILICONFLOW_BASE_URL
: ApiPath.SiliconFlow;
@@ -131,6 +134,9 @@ const DEFAULT_ACCESS_STATE = {
// siliconflow
siliconflowUrl: DEFAULT_SILICONFLOW_URL,
siliconflowApiKey: "",
// huawei
huaweiUrl: DEFAULT_HUAWEI_URL,
huaweiApiKey: "",
// server config
needCode: true,
@@ -219,6 +225,9 @@ export const useAccessStore = createPersistStore(
return ensure(get(), ["siliconflowApiKey"]);
},
isValidHuawei() {
return ensure(get(), ["huaweiApiKey"]);
},
isAuthorized() {
this.fetch();
@@ -238,6 +247,7 @@ export const useAccessStore = createPersistStore(
this.isValidXAI() ||
this.isValidChatGLM() ||
this.isValidSiliconFlow() ||
this.isValidHuawei() ||
!this.enabledAccessControl() ||
(this.enabledAccessControl() && ensure(get(), ["accessCode"]))
);