Decouple and fix mistral (#595)

* decouple and fix mistral

* fix wrong variable for currentBaseUrl and buildAPIProviderProperties
This commit is contained in:
lunamonke
2026-04-12 08:26:14 +01:00
committed by GitHub
parent b126e38b1a
commit 4c50977f3c
24 changed files with 556 additions and 46 deletions

View File

@@ -13,9 +13,9 @@ export type ProviderPreset =
| 'moonshotai'
| 'deepseek'
| 'gemini'
| 'mistral'
| 'together'
| 'groq'
| 'mistral'
| 'azure-openai'
| 'openrouter'
| 'lmstudio'
@@ -163,6 +163,15 @@ export function getProviderPresetDefaults(
apiKey: '',
requiresApiKey: true,
}
case 'mistral':
return {
provider: 'openai',
name: 'Mistral',
baseUrl: 'https://api.mistral.ai/v1',
model: 'devstral-latest',
apiKey: '',
requiresApiKey: true
}
case 'together':
return {
provider: 'openai',
@@ -181,15 +190,6 @@ export function getProviderPresetDefaults(
apiKey: '',
requiresApiKey: true,
}
case 'mistral':
return {
provider: 'openai',
name: 'Mistral',
baseUrl: 'https://api.mistral.ai/v1',
model: 'mistral-large-latest',
apiKey: '',
requiresApiKey: true,
}
case 'azure-openai':
return {
provider: 'openai',
@@ -258,6 +258,7 @@ function hasProviderSelectionFlags(
return (
processEnv.CLAUDE_CODE_USE_OPENAI !== undefined ||
processEnv.CLAUDE_CODE_USE_GEMINI !== undefined ||
processEnv.CLAUDE_CODE_USE_MISTRAL !== undefined ||
processEnv.CLAUDE_CODE_USE_GITHUB !== undefined ||
processEnv.CLAUDE_CODE_USE_BEDROCK !== undefined ||
processEnv.CLAUDE_CODE_USE_VERTEX !== undefined ||
@@ -319,6 +320,7 @@ function isProcessEnvAlignedWithProfile(
return (
processEnv.CLAUDE_CODE_USE_OPENAI !== undefined &&
processEnv.CLAUDE_CODE_USE_GEMINI === undefined &&
processEnv.CLAUDE_CODE_USE_MISTRAL === undefined &&
processEnv.CLAUDE_CODE_USE_GITHUB === undefined &&
processEnv.CLAUDE_CODE_USE_BEDROCK === undefined &&
processEnv.CLAUDE_CODE_USE_VERTEX === undefined &&
@@ -347,6 +349,7 @@ export function clearProviderProfileEnvFromProcessEnv(
): void {
delete processEnv.CLAUDE_CODE_USE_OPENAI
delete processEnv.CLAUDE_CODE_USE_GEMINI
delete processEnv.CLAUDE_CODE_USE_MISTRAL
delete processEnv.CLAUDE_CODE_USE_GITHUB
delete processEnv.CLAUDE_CODE_USE_BEDROCK
delete processEnv.CLAUDE_CODE_USE_VERTEX