Feat/Add ByteDance Ark provider (#226)
This commit is contained in:
committed by
GitHub
Unverified
parent
1b45d891c3
commit
8cda9235b3
42
tests/unit/providers.test.ts
Normal file
42
tests/unit/providers.test.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { PROVIDER_TYPES, PROVIDER_TYPE_INFO } from '@/lib/providers';
|
||||
import {
|
||||
BUILTIN_PROVIDER_TYPES,
|
||||
getProviderConfig,
|
||||
getProviderEnvVar,
|
||||
} from '@electron/utils/provider-registry';
|
||||
|
||||
describe('provider metadata', () => {
|
||||
it('includes ark in the frontend provider registry', () => {
|
||||
expect(PROVIDER_TYPES).toContain('ark');
|
||||
|
||||
expect(PROVIDER_TYPE_INFO).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
id: 'ark',
|
||||
name: 'ByteDance Ark',
|
||||
requiresApiKey: true,
|
||||
defaultBaseUrl: 'https://ark.cn-beijing.volces.com/api/v3',
|
||||
showBaseUrl: true,
|
||||
showModelId: true,
|
||||
}),
|
||||
])
|
||||
);
|
||||
});
|
||||
|
||||
it('includes ark in the backend provider registry', () => {
|
||||
expect(BUILTIN_PROVIDER_TYPES).toContain('ark');
|
||||
expect(getProviderEnvVar('ark')).toBe('ARK_API_KEY');
|
||||
expect(getProviderConfig('ark')).toEqual({
|
||||
baseUrl: 'https://ark.cn-beijing.volces.com/api/v3',
|
||||
api: 'openai-completions',
|
||||
apiKeyEnv: 'ARK_API_KEY',
|
||||
});
|
||||
});
|
||||
|
||||
it('keeps builtin provider sources in sync', () => {
|
||||
expect(BUILTIN_PROVIDER_TYPES).toEqual(
|
||||
expect.arrayContaining(['anthropic', 'openai', 'google', 'openrouter', 'ark', 'moonshot', 'siliconflow', 'minimax-portal', 'minimax-portal-cn', 'qwen-portal', 'ollama'])
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user