Commit e0cb9c1f by feitianbubu

feat: add image handling to image request for form-data

parent 86cd2802
package helper
import (
"encoding/json"
"errors"
"fmt"
"math"
......@@ -150,6 +151,9 @@ func GetAndValidOpenAIImageRequest(c *gin.Context, relayMode int) (*dto.ImageReq
imageRequest.N = uint(common.String2Int(formData.Get("n")))
imageRequest.Quality = formData.Get("quality")
imageRequest.Size = formData.Get("size")
if imageValue := formData.Get("image"); imageValue != "" {
imageRequest.Image, _ = json.Marshal(imageValue)
}
if imageRequest.Model == "gpt-image-1" {
if imageRequest.Quality == "" {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment