fix(api): 视频生成 - 修正 Video Generations 时长字段类型

This commit is contained in:
ddCat
2026-07-31 15:54:02 +08:00
parent bf339911e4
commit d94f4c6bed
2 changed files with 2 additions and 2 deletions

View File

@@ -1054,7 +1054,7 @@ func newAPIChannel2VideoBody(input canvasGenerationInput) (map[string]interface{
body := map[string]interface{}{
"model": input.Config.Model,
"prompt": strings.TrimSpace(input.Prompt),
"seconds": seconds,
"seconds": strconv.Itoa(seconds),
"aspect_ratio": ratio,
"resolution": resolution,
"generate_audio": parseBool(input.Config.VideoGenerateAudio, true),

View File

@@ -782,7 +782,7 @@ func TestRunNewAPIChannel2VideoTaskDownloadsTemporaryResult(t *testing.T) {
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
t.Fatalf("decode request: %v", err)
}
if body["model"] != "grok-image-video" || body["seconds"] != float64(10) || body["aspect_ratio"] != "9:16" || body["resolution"] != "720p" {
if body["model"] != "grok-image-video" || body["seconds"] != "10" || body["aspect_ratio"] != "9:16" || body["resolution"] != "720p" {
t.Errorf("body = %#v", body)
}
images, ok := body["image_urls"].([]interface{})