feat: initial support of Dall-E (#148, #266)

* feat: initial support of Dall-E

* fix: fix N not timed

---------

Co-authored-by: JustSong <songquanpeng@foxmail.com>
Co-authored-by: JustSong <39998050+songquanpeng@users.noreply.github.com>
This commit is contained in:
ckt
2023-07-15 12:30:06 +08:00
committed by GitHub
parent 81c5901123
commit b520b54625
7 changed files with 191 additions and 13 deletions

View File

@@ -79,6 +79,11 @@ func Distribute() func(c *gin.Context) {
modelRequest.Model = c.Param("model")
}
}
if strings.HasPrefix(c.Request.URL.Path, "/v1/images/generations") {
if modelRequest.Model == "" {
modelRequest.Model = "dall-e"
}
}
channel, err = model.CacheGetRandomSatisfiedChannel(userGroup, modelRequest.Model)
if err != nil {
message := "无可用渠道"