fix: seedance only one text
This commit is contained in:
parent
3cd1ba4673
commit
d36e892905
@ -19,6 +19,7 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
"github.com/samber/lo"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ============================
|
// ============================
|
||||||
@ -241,13 +242,11 @@ func (a *TaskAdaptor) convertToRequestPayload(req *relaycommon.TaskSubmitReq) (*
|
|||||||
return nil, errors.Wrap(err, "unmarshal metadata failed")
|
return nil, errors.Wrap(err, "unmarshal metadata failed")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add text prompt
|
r.Content = lo.Reject(r.Content, func(c ContentItem, _ int) bool { return c.Type == "text" })
|
||||||
if req.Prompt != "" {
|
r.Content = append(r.Content, ContentItem{
|
||||||
r.Content = append(r.Content, ContentItem{
|
Type: "text",
|
||||||
Type: "text",
|
Text: req.Prompt,
|
||||||
Text: req.Prompt,
|
})
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
return &r, nil
|
return &r, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user