| 255 | const clientConfig = getClientConfig(); |
| 256 | |
| 257 | function getConfig() { |
| 258 | const modelConfig = chatStore.currentSession().mask.modelConfig; |
| 259 | const isGoogle = modelConfig.providerName === ServiceProvider.Google; |
| 260 | const isAzure = modelConfig.providerName === ServiceProvider.Azure; |
| 261 | const isAnthropic = modelConfig.providerName === ServiceProvider.Anthropic; |
| 262 | const isBaidu = modelConfig.providerName == ServiceProvider.Baidu; |
| 263 | const isByteDance = modelConfig.providerName === ServiceProvider.ByteDance; |
| 264 | const isAlibaba = modelConfig.providerName === ServiceProvider.Alibaba; |
| 265 | const isMoonshot = modelConfig.providerName === ServiceProvider.Moonshot; |
| 266 | const isIflytek = modelConfig.providerName === ServiceProvider.Iflytek; |
| 267 | const isDeepSeek = modelConfig.providerName === ServiceProvider.DeepSeek; |
| 268 | const isXAI = modelConfig.providerName === ServiceProvider.XAI; |
| 269 | const isChatGLM = modelConfig.providerName === ServiceProvider.ChatGLM; |
| 270 | const isSiliconFlow = |
| 271 | modelConfig.providerName === ServiceProvider.SiliconFlow; |
| 272 | const isAI302 = modelConfig.providerName === ServiceProvider["302.AI"]; |
| 273 | const isEnabledAccessControl = accessStore.enabledAccessControl(); |
| 274 | const apiKey = isGoogle |
| 275 | ? accessStore.googleApiKey |
| 276 | : isAzure |
| 277 | ? accessStore.azureApiKey |
| 278 | : isAnthropic |
| 279 | ? accessStore.anthropicApiKey |
| 280 | : isByteDance |
| 281 | ? accessStore.bytedanceApiKey |
| 282 | : isAlibaba |
| 283 | ? accessStore.alibabaApiKey |
| 284 | : isMoonshot |
| 285 | ? accessStore.moonshotApiKey |
| 286 | : isXAI |
| 287 | ? accessStore.xaiApiKey |
| 288 | : isDeepSeek |
| 289 | ? accessStore.deepseekApiKey |
| 290 | : isChatGLM |
| 291 | ? accessStore.chatglmApiKey |
| 292 | : isSiliconFlow |
| 293 | ? accessStore.siliconflowApiKey |
| 294 | : isIflytek |
| 295 | ? accessStore.iflytekApiKey && accessStore.iflytekApiSecret |
| 296 | ? accessStore.iflytekApiKey + ":" + accessStore.iflytekApiSecret |
| 297 | : "" |
| 298 | : isAI302 |
| 299 | ? accessStore.ai302ApiKey |
| 300 | : accessStore.openaiApiKey; |
| 301 | return { |
| 302 | isGoogle, |
| 303 | isAzure, |
| 304 | isAnthropic, |
| 305 | isBaidu, |
| 306 | isByteDance, |
| 307 | isAlibaba, |
| 308 | isMoonshot, |
| 309 | isIflytek, |
| 310 | isDeepSeek, |
| 311 | isXAI, |
| 312 | isChatGLM, |
| 313 | isSiliconFlow, |
| 314 | isAI302, |