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
Some checks failed
Build & Push Docker Image / build-and-push (push) Has been cancelled
This commit is contained in:
@@ -17,7 +17,7 @@ export interface TestProviderResult {
|
|||||||
steps: TestStep[]
|
steps: TestStep[]
|
||||||
}
|
}
|
||||||
|
|
||||||
type PresetProviderType = 'ark' | 'google' | 'openrouter' | 'minimax' | 'fal' | 'vidu'
|
type PresetProviderType = 'ark' | 'google' | 'openrouter' | 'minimax' | 'fal' | 'vidu' | 'grok2'
|
||||||
| 'bailian'
|
| 'bailian'
|
||||||
| 'siliconflow'
|
| 'siliconflow'
|
||||||
type CompatibleProviderType = 'openai-compatible' | 'gemini-compatible'
|
type CompatibleProviderType = 'openai-compatible' | 'gemini-compatible'
|
||||||
@@ -843,7 +843,7 @@ export async function testProviderConnection(payload: TestProviderPayload): Prom
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Compatible providers require baseUrl
|
// Compatible providers require baseUrl
|
||||||
if ((apiType === 'openai-compatible' || apiType === 'gemini-compatible') && !baseUrl) {
|
if ((apiType === 'openai-compatible' || apiType === 'gemini-compatible' || apiType === 'grok2') && !baseUrl) {
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false,
|
||||||
steps: [{ name: 'models', status: 'fail', message: 'Missing baseUrl' }],
|
steps: [{ name: 'models', status: 'fail', message: 'Missing baseUrl' }],
|
||||||
@@ -855,6 +855,8 @@ export async function testProviderConnection(payload: TestProviderPayload): Prom
|
|||||||
return testCompatibleProvider(baseUrl!, apiKey, llmModel)
|
return testCompatibleProvider(baseUrl!, apiKey, llmModel)
|
||||||
case 'gemini-compatible':
|
case 'gemini-compatible':
|
||||||
return testCompatibleProvider(baseUrl!, apiKey, llmModel)
|
return testCompatibleProvider(baseUrl!, apiKey, llmModel)
|
||||||
|
case 'grok2':
|
||||||
|
return testCompatibleProvider(baseUrl!, apiKey, llmModel)
|
||||||
case 'ark':
|
case 'ark':
|
||||||
return testArkProvider(apiKey)
|
return testArkProvider(apiKey)
|
||||||
case 'google':
|
case 'google':
|
||||||
|
|||||||
Reference in New Issue
Block a user