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