mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-04-19 09:48:39 +00:00
fix: improve error message for unsupported image generation models
This commit is contained in:
@@ -59,7 +59,7 @@ func (a *Adaptor) ConvertAudioRequest(c *gin.Context, info *relaycommon.RelayInf
|
|||||||
|
|
||||||
func (a *Adaptor) ConvertImageRequest(c *gin.Context, info *relaycommon.RelayInfo, request dto.ImageRequest) (any, error) {
|
func (a *Adaptor) ConvertImageRequest(c *gin.Context, info *relaycommon.RelayInfo, request dto.ImageRequest) (any, error) {
|
||||||
if !strings.HasPrefix(info.UpstreamModelName, "imagen") {
|
if !strings.HasPrefix(info.UpstreamModelName, "imagen") {
|
||||||
return nil, errors.New("not supported model for image generation")
|
return nil, errors.New("not supported model for image generation, only imagen models are supported")
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert size to aspect ratio but allow user to specify aspect ratio
|
// convert size to aspect ratio but allow user to specify aspect ratio
|
||||||
|
|||||||
Reference in New Issue
Block a user