@@ -34,6 +34,7 @@ export const initChatModelWithConfig = async (
34
34
azureOpenAIApiDeploymentName :
35
35
config . azureConfig . azureOpenAIApiDeploymentName ,
36
36
azureOpenAIApiVersion : config . azureConfig . azureOpenAIApiVersion ,
37
+ azureOpenAIBasePath : config . azureConfig . azureOpenAIBasePath ,
37
38
}
38
39
: { } ) ,
39
40
} ) ;
@@ -159,14 +160,14 @@ export const getModelConfig = (
159
160
azureOpenAIApiInstanceName : string ;
160
161
azureOpenAIApiDeploymentName : string ;
161
162
azureOpenAIApiVersion : string ;
163
+ azureOpenAIBasePath ?: string ;
162
164
} ;
163
165
} => {
164
166
const customModelName = config . configurable ?. customModelName as string ;
165
167
if ( ! customModelName ) {
166
168
throw new Error ( "Model name is missing in config." ) ;
167
169
}
168
170
169
- // Handle Azure OpenAI models
170
171
if ( customModelName . startsWith ( "azure/" ) ) {
171
172
const actualModelName = customModelName . replace ( "azure/" , "" ) ;
172
173
return {
@@ -180,11 +181,11 @@ export const getModelConfig = (
180
181
process . env . AZURE_OPENAI_API_DEPLOYMENT_NAME || "" ,
181
182
azureOpenAIApiVersion :
182
183
process . env . AZURE_OPENAI_API_VERSION || "2024-08-01-preview" ,
184
+ azureOpenAIBasePath : process . env . AZURE_OPENAI_API_BASE_PATH ,
183
185
} ,
184
186
} ;
185
187
}
186
188
187
- // Handle existing model providers
188
189
if ( customModelName . includes ( "gpt-" ) ) {
189
190
return {
190
191
modelName : customModelName ,
0 commit comments