fix: add grok2 to testProviderConnection switch so key save and model toggle work
Some checks failed
Build & Push Docker Image / build-and-push (push) Has been cancelled

This commit is contained in:
shiyue
2026-03-11 14:46:14 +00:00
parent 7ec38730e9
commit 7f916b96d2

View File

@@ -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':