Explorar el Código

Merge branch 'pr/fix-kling-text2image' of github.com:feitianbubu/new-api into feitianbubu-pr/fix-kling-text2image

creamlike1024 hace 6 meses
padre
commit
9c798dcd16
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      relay/channel/task/kling/adaptor.go

+ 3 - 0
relay/channel/task/kling/adaptor.go

@@ -172,6 +172,9 @@ func (a *TaskAdaptor) BuildRequestBody(c *gin.Context, info *relaycommon.RelayIn
 	if err != nil {
 		return nil, err
 	}
+	if body.Image == "" && body.ImageTail == "" {
+		c.Set("action", constant.TaskActionTextGenerate)
+	}
 	data, err := json.Marshal(body)
 	if err != nil {
 		return nil, err