Add Atlas Cloud LLM preset (#844)
Co-authored-by: binyangzhu000-sudo <224954946+binyangzhu000-sudo@users.noreply.github.com>
This commit is contained in:
1 parent
857ea6dc21
commit
ef66246623
10 files changed
+45
-1
No files matched your search
@@ -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 头。
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -773,6 +773,7 @@ export const zhCN = {
|
||||
ark: 'ARK(火山方舟)',
|
||||
deepseek: 'DeepSeek',
|
||||
siliconflow: '硅基流动',
|
||||
atlascloud: 'Atlas Cloud',
|
||||
openai: 'OpenAI',
|
||||
gemini: 'Google Gemini',
|
||||
codexOAuth: 'Codex OAuth',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -36,6 +36,7 @@ const LLM_NAME_KEY_BY_ID: Record<string, string> = {
|
||||
ark: 'ark',
|
||||
deepseek: 'deepseek',
|
||||
siliconflow: 'siliconflow',
|
||||
atlascloud: 'atlascloud',
|
||||
openai: 'openai',
|
||||
codex_oauth: 'codexOAuth',
|
||||
mimo: 'mimo',
|
||||
|
||||
@@ -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}`);
|
||||
}
|
||||
@@ -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',
|
||||
|
||||
Reference in new issue
Block a user