File tree Expand file tree Collapse file tree 6 files changed +15
-1
lines changed
webview-ui/src/components/settings Expand file tree Collapse file tree 6 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -358,6 +358,7 @@ export const providerSettingsSchema = z.object({
358358 googleGeminiBaseUrl : z . string ( ) . optional ( ) ,
359359 // OpenAI Native
360360 openAiNativeApiKey : z . string ( ) . optional ( ) ,
361+ openAiNativeBaseUrl : z . string ( ) . optional ( ) ,
361362 // XAI
362363 xaiApiKey : z . string ( ) . optional ( ) ,
363364 // Mistral
@@ -445,6 +446,7 @@ const providerSettingsRecord: ProviderSettingsRecord = {
445446 googleGeminiBaseUrl : undefined ,
446447 // OpenAI Native
447448 openAiNativeApiKey : undefined ,
449+ openAiNativeBaseUrl : undefined ,
448450 // Mistral
449451 mistralApiKey : undefined ,
450452 mistralCodestralUrl : undefined ,
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ export class OpenAiNativeHandler extends BaseProvider implements SingleCompletio
2929 super ( )
3030 this . options = options
3131 const apiKey = this . options . openAiNativeApiKey ?? "not-provided"
32- this . client = new OpenAI ( { apiKey } )
32+ this . client = new OpenAI ( { baseURL : this . options . openAiNativeBaseUrl , apiKey } )
3333 }
3434
3535 override async * createMessage ( systemPrompt : string , messages : Anthropic . Messages . MessageParam [ ] ) : ApiStream {
Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ type ProviderSettings = {
105105 geminiApiKey ?: string | undefined
106106 googleGeminiBaseUrl ?: string | undefined
107107 openAiNativeApiKey ?: string | undefined
108+ openAiNativeBaseUrl ?: string | undefined
108109 mistralApiKey ?: string | undefined
109110 mistralCodestralUrl ?: string | undefined
110111 deepSeekBaseUrl ?: string | undefined
Original file line number Diff line number Diff line change @@ -106,6 +106,7 @@ type ProviderSettings = {
106106 geminiApiKey ?: string | undefined
107107 googleGeminiBaseUrl ?: string | undefined
108108 openAiNativeApiKey ?: string | undefined
109+ openAiNativeBaseUrl ?: string | undefined
109110 mistralApiKey ?: string | undefined
110111 mistralCodestralUrl ?: string | undefined
111112 deepSeekBaseUrl ?: string | undefined
Original file line number Diff line number Diff line change @@ -401,6 +401,7 @@ export const providerSettingsSchema = z.object({
401401 googleGeminiBaseUrl : z . string ( ) . optional ( ) ,
402402 // OpenAI Native
403403 openAiNativeApiKey : z . string ( ) . optional ( ) ,
404+ openAiNativeBaseUrl : z . string ( ) . optional ( ) ,
404405 // Mistral
405406 mistralApiKey : z . string ( ) . optional ( ) ,
406407 mistralCodestralUrl : z . string ( ) . optional ( ) ,
@@ -492,6 +493,7 @@ const providerSettingsRecord: ProviderSettingsRecord = {
492493 googleGeminiBaseUrl : undefined ,
493494 // OpenAI Native
494495 openAiNativeApiKey : undefined ,
496+ openAiNativeBaseUrl : undefined ,
495497 // Mistral
496498 mistralApiKey : undefined ,
497499 mistralCodestralUrl : undefined ,
Original file line number Diff line number Diff line change @@ -490,6 +490,14 @@ const ApiOptions = ({
490490
491491 { selectedProvider === "openai-native" && (
492492 < >
493+ < VSCodeTextField
494+ value = { apiConfiguration ?. openAiNativeBaseUrl || "" }
495+ type = "url"
496+ onInput = { handleInputChange ( "openAiNativeBaseUrl" ) }
497+ placeholder = { t ( "settings:placeholders.baseUrl" ) }
498+ className = "w-full" >
499+ < label className = "block font-medium mb-1" > { t ( "settings:providers.openAiBaseUrl" ) } </ label >
500+ </ VSCodeTextField >
493501 < VSCodeTextField
494502 value = { apiConfiguration ?. openAiNativeApiKey || "" }
495503 type = "password"
You can’t perform that action at this time.
0 commit comments