diff --git a/src/lib/user-api/provider-test.ts b/src/lib/user-api/provider-test.ts index 56cdd6c..febb297 100644 --- a/src/lib/user-api/provider-test.ts +++ b/src/lib/user-api/provider-test.ts @@ -17,7 +17,7 @@ export interface TestProviderResult { steps: TestStep[] } -type PresetProviderType = 'ark' | 'google' | 'openrouter' | 'minimax' | 'fal' | 'vidu' +type PresetProviderType = 'ark' | 'google' | 'openrouter' | 'minimax' | 'fal' | 'vidu' | 'grok2' | 'bailian' | 'siliconflow' type CompatibleProviderType = 'openai-compatible' | 'gemini-compatible' @@ -843,7 +843,7 @@ export async function testProviderConnection(payload: TestProviderPayload): Prom } // Compatible providers require baseUrl - if ((apiType === 'openai-compatible' || apiType === 'gemini-compatible') && !baseUrl) { + if ((apiType === 'openai-compatible' || apiType === 'gemini-compatible' || apiType === 'grok2') && !baseUrl) { return { success: false, steps: [{ name: 'models', status: 'fail', message: 'Missing baseUrl' }], @@ -855,6 +855,8 @@ export async function testProviderConnection(payload: TestProviderPayload): Prom return testCompatibleProvider(baseUrl!, apiKey, llmModel) case 'gemini-compatible': return testCompatibleProvider(baseUrl!, apiKey, llmModel) + case 'grok2': + return testCompatibleProvider(baseUrl!, apiKey, llmModel) case 'ark': return testArkProvider(apiKey) case 'google':