feat: seedance support seconds
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/QuantumNous/new-api/common"
|
"github.com/QuantumNous/new-api/common"
|
||||||
@@ -242,6 +243,10 @@ func (a *TaskAdaptor) convertToRequestPayload(req *relaycommon.TaskSubmitReq) (*
|
|||||||
return nil, errors.Wrap(err, "unmarshal metadata failed")
|
return nil, errors.Wrap(err, "unmarshal metadata failed")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if sec, _ := strconv.Atoi(req.Seconds); sec > 0 {
|
||||||
|
r.Duration = lo.ToPtr(dto.IntValue(sec))
|
||||||
|
}
|
||||||
|
|
||||||
r.Content = lo.Reject(r.Content, func(c ContentItem, _ int) bool { return c.Type == "text" })
|
r.Content = lo.Reject(r.Content, func(c ContentItem, _ int) bool { return c.Type == "text" })
|
||||||
r.Content = append(r.Content, ContentItem{
|
r.Content = append(r.Content, ContentItem{
|
||||||
Type: "text",
|
Type: "text",
|
||||||
|
|||||||
Reference in New Issue
Block a user