feat: add Azure OpenAI support for chat models

This commit is contained in:
liweixin
2026-04-07 19:12:58 +08:00
committed by lyingbug
parent c9001ef9d9
commit 22ec575727
2 changed files with 40 additions and 7 deletions
+13
View File
@@ -394,6 +394,8 @@ func (s *modelService) GetChatModel(ctx context.Context, modelId string) (chat.C
BaseURL: model.Parameters.BaseURL,
ModelName: model.Name,
Source: model.Source,
Provider: model.Parameters.Provider,
Extra: stringMapToAnyMap(model.Parameters.ExtraConfig),
}, s.ollamaService)
if err != nil {
logger.ErrorWithFields(ctx, err, map[string]interface{}{
@@ -500,3 +502,14 @@ func (s *modelService) GetASRModel(ctx context.Context, modelId string) (asr.ASR
return sttModel, nil
}
func stringMapToAnyMap(m map[string]string) map[string]any {
if m == nil {
return nil
}
result := make(map[string]any, len(m))
for k, v := range m {
result[k] = v
}
return result
}