fix: override AzureModelMapperFunc to preserve deployment name as-is
parent
4e4118d406
commit
c6215405a5
|
|
@ -66,6 +66,9 @@ func NewRemoteAPIChat(chatConfig *ChatConfig) (*RemoteAPIChat, error) {
|
|||
var config openai.ClientConfig
|
||||
if providerName == provider.ProviderAzureOpenAI {
|
||||
config = openai.DefaultAzureConfig(apiKey, chatConfig.BaseURL)
|
||||
config.AzureModelMapperFunc = func(model string) string {
|
||||
return model
|
||||
}
|
||||
if chatConfig.Extra != nil {
|
||||
if v, ok := chatConfig.Extra["api_version"]; ok {
|
||||
if vs, ok := v.(string); ok && vs != "" {
|
||||
|
|
|
|||
|
|
@ -37,6 +37,9 @@ func NewRemoteAPIVLM(config *Config) (*RemoteAPIVLM, error) {
|
|||
var apiCfg openai.ClientConfig
|
||||
if providerName == provider.ProviderAzureOpenAI {
|
||||
apiCfg = openai.DefaultAzureConfig(config.APIKey, config.BaseURL)
|
||||
apiCfg.AzureModelMapperFunc = func(model string) string {
|
||||
return model
|
||||
}
|
||||
if config.Extra != nil {
|
||||
if v, ok := config.Extra["api_version"]; ok {
|
||||
if vs, ok := v.(string); ok && vs != "" {
|
||||
|
|
|
|||
Loading…
Reference in New Issue