Sfoglia il codice sorgente

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

creamlike1024 6 mesi fa
parent
commit
9c798dcd16
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  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