修复DALLE function call bug

This commit is contained in:
GeekMaster
2025-04-22 15:47:21 +08:00
parent c2d4530395
commit b97d4b7895

View File

@@ -132,7 +132,11 @@ func (s *Service) Image(task types.DallTask, sync bool) (string, error) {
}
var chatModel model.ChatModel
s.db.Where("id = ?", task.ModelId).First(&chatModel)
if task.ModelId > 0 {
s.db.Where("id", task.ModelId).First(&chatModel)
} else {
s.db.Where("value", task.ModelName).First(&chatModel)
}
// get image generation API KEY
var apiKey model.ApiKey