From ef662466230e529b2ef5d33254917d6b10dd4d16 Mon Sep 17 00:00:00 2001 From: nb213 Date: Tue, 21 Jul 2026 21:56:40 +0800 Subject: [PATCH] Add Atlas Cloud LLM preset (#844) Co-authored-by: binyangzhu000-sudo <224954946+binyangzhu000-sudo@users.noreply.github.com> --- .../app/src-tauri/src/commands/credentials.rs | 1 + openless-all/app/src-tauri/src/commands/mod.rs | 16 ++++++++++++++++ openless-all/app/src/i18n/en.ts | 1 + openless-all/app/src/i18n/ja.ts | 1 + openless-all/app/src/i18n/ko.ts | 1 + openless-all/app/src/i18n/zh-CN.ts | 1 + openless-all/app/src/i18n/zh-TW.ts | 1 + openless-all/app/src/pages/Overview.tsx | 1 + .../src/pages/settings/ProvidersSection.test.ts | 15 +++++++++++++++ .../app/src/pages/settings/ProvidersSection.tsx | 8 +++++++- 10 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 openless-all/app/src/pages/settings/ProvidersSection.test.ts diff --git a/openless-all/app/src-tauri/src/commands/credentials.rs b/openless-all/app/src-tauri/src/commands/credentials.rs index 7ed34ba1..274b8b71 100644 --- a/openless-all/app/src-tauri/src/commands/credentials.rs +++ b/openless-all/app/src-tauri/src/commands/credentials.rs @@ -83,6 +83,7 @@ fn llm_provider_default_endpoint(provider: &str) -> Option<&'static str> { "ark" => Some("https://ark.cn-beijing.volces.com/api/v3"), "deepseek" => Some("https://api.deepseek.com/v1"), "siliconflow" => Some("https://api.siliconflow.cn/v1"), + "atlascloud" => Some("https://api.atlascloud.ai/v1"), "openai" => Some("https://api.openai.com/v1"), // 谷歌 Gemini 原生 API(v1beta)。后端 llm_gemini.rs 会拼成 // `{baseUrl}/models/{model}:generateContent`,认证用 x-goog-api-key 头。 diff --git a/openless-all/app/src-tauri/src/commands/mod.rs b/openless-all/app/src-tauri/src/commands/mod.rs index a3a483f0..69049ed5 100644 --- a/openless-all/app/src-tauri/src/commands/mod.rs +++ b/openless-all/app/src-tauri/src/commands/mod.rs @@ -566,6 +566,22 @@ mod tests { )); } + #[test] + fn credentials_status_requires_api_key_for_atlascloud() { + let keyless = CredentialsSnapshot { + ark_endpoint: Some("https://api.atlascloud.ai/v1".into()), + ark_model_id: Some("qwen/qwen3.5-flash".into()), + ..snapshot() + }; + assert!(!llm_configured_for_provider("atlascloud", &keyless)); + + let ready = CredentialsSnapshot { + ark_api_key: Some("key".into()), + ..keyless + }; + assert!(llm_configured_for_provider("atlascloud", &ready)); + } + impl SettingsWriter for FakeSettingsWriter { fn read_settings(&self) -> UserPreferences { self.saved.lock().unwrap().clone().unwrap_or_default() diff --git a/openless-all/app/src/i18n/en.ts b/openless-all/app/src/i18n/en.ts index d12da35e..2dc38236 100644 --- a/openless-all/app/src/i18n/en.ts +++ b/openless-all/app/src/i18n/en.ts @@ -775,6 +775,7 @@ export const en: typeof zhCN = { ark: 'ARK (Volcengine Ark)', deepseek: 'DeepSeek', siliconflow: 'SiliconFlow', + atlascloud: 'Atlas Cloud', openai: 'OpenAI', gemini: 'Google Gemini', codexOAuth: 'Codex OAuth', diff --git a/openless-all/app/src/i18n/ja.ts b/openless-all/app/src/i18n/ja.ts index b747c435..141eaa06 100644 --- a/openless-all/app/src/i18n/ja.ts +++ b/openless-all/app/src/i18n/ja.ts @@ -777,6 +777,7 @@ export const ja: typeof zhCN = { ark: 'ARK(Volcengine Ark)', deepseek: 'DeepSeek', siliconflow: 'SiliconFlow', + atlascloud: 'Atlas Cloud', openai: 'OpenAI', gemini: 'Google Gemini', codexOAuth: 'Codex OAuth', diff --git a/openless-all/app/src/i18n/ko.ts b/openless-all/app/src/i18n/ko.ts index c0a7acd9..c59bed6c 100644 --- a/openless-all/app/src/i18n/ko.ts +++ b/openless-all/app/src/i18n/ko.ts @@ -777,6 +777,7 @@ export const ko: typeof zhCN = { ark: 'ARK (Volcengine Ark)', deepseek: 'DeepSeek', siliconflow: 'SiliconFlow', + atlascloud: 'Atlas Cloud', openai: 'OpenAI', gemini: 'Google Gemini', codexOAuth: 'Codex OAuth', diff --git a/openless-all/app/src/i18n/zh-CN.ts b/openless-all/app/src/i18n/zh-CN.ts index bfe6011c..1280714f 100644 --- a/openless-all/app/src/i18n/zh-CN.ts +++ b/openless-all/app/src/i18n/zh-CN.ts @@ -773,6 +773,7 @@ export const zhCN = { ark: 'ARK(火山方舟)', deepseek: 'DeepSeek', siliconflow: '硅基流动', + atlascloud: 'Atlas Cloud', openai: 'OpenAI', gemini: 'Google Gemini', codexOAuth: 'Codex OAuth', diff --git a/openless-all/app/src/i18n/zh-TW.ts b/openless-all/app/src/i18n/zh-TW.ts index 88e7c8a5..82dfdb23 100644 --- a/openless-all/app/src/i18n/zh-TW.ts +++ b/openless-all/app/src/i18n/zh-TW.ts @@ -775,6 +775,7 @@ export const zhTW: typeof zhCN = { ark: 'ARK(火山方舟)', deepseek: 'DeepSeek', siliconflow: '硅基流動', + atlascloud: 'Atlas Cloud', openai: 'OpenAI', gemini: 'Google Gemini', codexOAuth: 'Codex OAuth', diff --git a/openless-all/app/src/pages/Overview.tsx b/openless-all/app/src/pages/Overview.tsx index 7aa2784d..4d9b845f 100644 --- a/openless-all/app/src/pages/Overview.tsx +++ b/openless-all/app/src/pages/Overview.tsx @@ -36,6 +36,7 @@ const LLM_NAME_KEY_BY_ID: Record = { ark: 'ark', deepseek: 'deepseek', siliconflow: 'siliconflow', + atlascloud: 'atlascloud', openai: 'openai', codex_oauth: 'codexOAuth', mimo: 'mimo', diff --git a/openless-all/app/src/pages/settings/ProvidersSection.test.ts b/openless-all/app/src/pages/settings/ProvidersSection.test.ts new file mode 100644 index 00000000..b828b1f0 --- /dev/null +++ b/openless-all/app/src/pages/settings/ProvidersSection.test.ts @@ -0,0 +1,15 @@ +import { LLM_PRESETS } from './ProvidersSection'; + +const atlascloudPreset = LLM_PRESETS.find(p => p.id === 'atlascloud'); + +if (!atlascloudPreset) { + throw new Error('Atlas Cloud LLM preset is missing'); +} + +if (atlascloudPreset.baseUrl !== 'https://api.atlascloud.ai/v1') { + throw new Error(`unexpected Atlas Cloud base URL: ${atlascloudPreset.baseUrl}`); +} + +if (atlascloudPreset.modelPlaceholder !== 'qwen/qwen3.5-flash') { + throw new Error(`unexpected Atlas Cloud default model: ${atlascloudPreset.modelPlaceholder}`); +} diff --git a/openless-all/app/src/pages/settings/ProvidersSection.tsx b/openless-all/app/src/pages/settings/ProvidersSection.tsx index c645346b..72a38ecf 100644 --- a/openless-all/app/src/pages/settings/ProvidersSection.tsx +++ b/openless-all/app/src/pages/settings/ProvidersSection.tsx @@ -47,7 +47,7 @@ function LlmThinkingToggle({ enabled, onToggle }: { enabled: boolean; onToggle: ); } -const LLM_PRESETS = [ +export const LLM_PRESETS = [ { id: 'ark', nameKey: 'ark', @@ -66,6 +66,12 @@ const LLM_PRESETS = [ baseUrl: 'https://api.siliconflow.cn/v1', modelPlaceholder: 'Qwen/Qwen2.5-7B-Instruct', }, + { + id: 'atlascloud', + nameKey: 'atlascloud', + baseUrl: 'https://api.atlascloud.ai/v1', + modelPlaceholder: 'qwen/qwen3.5-flash', + }, { id: 'openai', nameKey: 'openai',