feat: support baidu model

This commit is contained in:
Dogtiti
2024-07-06 13:05:09 +08:00
parent 2d1f522aaf
commit 785d3748e1
14 changed files with 586 additions and 4 deletions

View File

@@ -47,6 +47,11 @@ const DEFAULT_ACCESS_STATE = {
anthropicApiVersion: "2023-06-01",
anthropicUrl: "",
// baidu
baiduUrl: "",
baiduApiKey: "",
baiduSecretKey: "",
// server config
needCode: true,
hideUserApiKey: false,
@@ -83,6 +88,10 @@ export const useAccessStore = createPersistStore(
return ensure(get(), ["anthropicApiKey"]);
},
isValidBaidu() {
return ensure(get(), ["baiduApiKey", "baiduSecretKey"]);
},
isAuthorized() {
this.fetch();
@@ -92,6 +101,7 @@ export const useAccessStore = createPersistStore(
this.isValidAzure() ||
this.isValidGoogle() ||
this.isValidAnthropic() ||
this.isValidBaidu() ||
!this.enabledAccessControl() ||
(this.enabledAccessControl() && ensure(get(), ["accessCode"]))
);