chore: update impl

This commit is contained in:
JustSong
2023-11-17 20:01:39 +08:00
parent cb3d43768e
commit 9afcbf556e
3 changed files with 4 additions and 3 deletions

View File

@@ -37,7 +37,6 @@ func relayImageHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode
group := c.GetString("group")
var imageRequest ImageRequest
if consumeQuota {
err := common.UnmarshalBodyReusable(c, &imageRequest)
if err != nil {
@@ -82,7 +81,7 @@ func relayImageHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode
// Number of generated images validation
if isWithinRange(imageModel, imageRequest.N) == false {
return errorWrapper(errors.New("invalud value of n"), "n_not_within_range", http.StatusBadRequest)
return errorWrapper(errors.New("invalid value of n"), "n_not_within_range", http.StatusBadRequest)
}
// map model name

View File

@@ -77,6 +77,7 @@ type TextRequest struct {
//Stream bool `json:"stream"`
}
// ImageRequest docs: https://platform.openai.com/docs/api-reference/images/create
type ImageRequest struct {
Model string `json:"model"`
Prompt string `json:"prompt" binding:"required"`
@@ -85,6 +86,7 @@ type ImageRequest struct {
Quality string `json:"quality"`
ResponseFormat string `json:"response_format"`
Style string `json:"style"`
User string `json:"user"`
}
type AudioResponse struct {