Skip to content

Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.

fix: override AzureModelMapperFunc to preserve deployment name as-is

liweixinc6215405a520
diff --git a/internal/models/chat/remote_api.go b/internal/models/chat/remote_api.go
index 357eb66ae..39e3ae536 100644
--- a/internal/models/chat/remote_api.go
+++ b/internal/models/chat/remote_api.go
@@ -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 != "" {
diff --git a/internal/models/vlm/remote_api.go b/internal/models/vlm/remote_api.go
index 8452de313..8dd417283 100644
--- a/internal/models/vlm/remote_api.go
+++ b/internal/models/vlm/remote_api.go
@@ -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 != "" {