fix: make modelType take precedence over all env vars in getAPIProvider
This commit is contained in:
parent
72b13ee215
commit
ef80d21dbe
|
|
@ -9,13 +9,11 @@ export type APIProvider =
|
||||||
| 'foundry'
|
| 'foundry'
|
||||||
| 'openai'
|
| 'openai'
|
||||||
| 'gemini'
|
| 'gemini'
|
||||||
| 'grok'
|
|
||||||
|
|
||||||
export function getAPIProvider(): APIProvider {
|
export function getAPIProvider(): APIProvider {
|
||||||
const modelType = getInitialSettings().modelType
|
const modelType = getInitialSettings().modelType
|
||||||
if (modelType === 'openai') return 'openai'
|
if (modelType === 'openai') return 'openai'
|
||||||
if (modelType === 'gemini') return 'gemini'
|
if (modelType === 'gemini') return 'gemini'
|
||||||
if (modelType === 'grok') return 'grok'
|
|
||||||
|
|
||||||
if (isEnvTruthy(process.env.CLAUDE_CODE_USE_BEDROCK)) return 'bedrock'
|
if (isEnvTruthy(process.env.CLAUDE_CODE_USE_BEDROCK)) return 'bedrock'
|
||||||
if (isEnvTruthy(process.env.CLAUDE_CODE_USE_VERTEX)) return 'vertex'
|
if (isEnvTruthy(process.env.CLAUDE_CODE_USE_VERTEX)) return 'vertex'
|
||||||
|
|
@ -23,7 +21,6 @@ export function getAPIProvider(): APIProvider {
|
||||||
|
|
||||||
if (isEnvTruthy(process.env.CLAUDE_CODE_USE_OPENAI)) return 'openai'
|
if (isEnvTruthy(process.env.CLAUDE_CODE_USE_OPENAI)) return 'openai'
|
||||||
if (isEnvTruthy(process.env.CLAUDE_CODE_USE_GEMINI)) return 'gemini'
|
if (isEnvTruthy(process.env.CLAUDE_CODE_USE_GEMINI)) return 'gemini'
|
||||||
if (isEnvTruthy(process.env.CLAUDE_CODE_USE_GROK)) return 'grok'
|
|
||||||
|
|
||||||
return 'firstParty'
|
return 'firstParty'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user