Skip to content

Commit 6cfe0bf

Browse files
feat: add Atlas Cloud AI playground provider (#250)
Co-authored-by: binyangzhu000-sudo <224954946+binyangzhu000-sudo@users.noreply.github.com>
1 parent 69eae2e commit 6cfe0bf

4 files changed

Lines changed: 15 additions & 4 deletions

File tree

‎site/src/components/AIPlayground/ConfigPanel.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ export function ConfigPanel({
6969
const baseUrl = (stored && stored.baseUrl) || preset.baseUrl || '';
7070
const nextConfig: AIConfig =
7171
stored && stored.provider === provider
72-
? {...stored, baseUrl}
72+
? {...stored, baseUrl, model: stored.model || preset.model || ''}
7373
: {
7474
provider,
7575
baseUrl,
76-
model: '',
76+
model: preset.model || '',
7777
apiKey: '',
7878
};
7979
setDraft(nextConfig);
@@ -90,7 +90,7 @@ export function ConfigPanel({
9090
setDraft({
9191
provider: safeProvider,
9292
baseUrl: value.baseUrl || preset?.baseUrl || DEFAULT_CONFIG.baseUrl,
93-
model: value.model,
93+
model: value.model || preset?.model || '',
9494
apiKey: value.apiKey,
9595
});
9696
setModels(value.model ? [value.model] : []);

‎site/src/components/AIPlayground/Service.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export async function fetchModels(
4343
case 'deepseek':
4444
case 'xai':
4545
case 'qwen':
46+
case 'atlascloud':
4647
return fetchOpenAIModels(normalizedBase, apiKey);
4748
case 'anthropic':
4849
return fetchAnthropicModels(normalizedBase, apiKey);
@@ -158,6 +159,7 @@ async function callAI(
158159
case 'deepseek':
159160
case 'xai':
160161
case 'qwen':
162+
case 'atlascloud':
161163
return callOpenAICompatible(
162164
baseURL,
163165
apiKey,
@@ -409,6 +411,7 @@ function extractContentFromResponse(provider: AIProvider, data: any): string {
409411
case 'deepseek':
410412
case 'xai':
411413
case 'qwen':
414+
case 'atlascloud':
412415
return data.choices?.[0]?.delta?.content || '';
413416
case 'anthropic':
414417
if (data.type === 'content_block_delta') {

‎site/src/components/AIPlayground/constants.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const PROVIDER_OPTIONS: Array<{
1717
value: AIProvider;
1818
label: string;
1919
baseUrl: string;
20+
model?: string;
2021
logo?: string;
2122
}> = [
2223
{
@@ -61,4 +62,10 @@ export const PROVIDER_OPTIONS: Array<{
6162
baseUrl: 'https://dashscope.aliyuncs.com/compatible-mode/v1',
6263
logo: '/images/qwen.svg',
6364
},
65+
{
66+
value: 'atlascloud',
67+
label: 'Atlas Cloud',
68+
baseUrl: 'https://api.atlascloud.ai/v1',
69+
model: 'deepseek-ai/deepseek-v4-pro',
70+
},
6471
];

‎site/src/components/AIPlayground/types.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ export type AIProvider =
1414
| 'google'
1515
| 'xai'
1616
| 'deepseek'
17-
| 'qwen';
17+
| 'qwen'
18+
| 'atlascloud';
1819

1920
export type AIConfig = {
2021
provider: AIProvider;

0 commit comments

Comments
 (0)