From d94f4c6bedb777acd64d4aed4e8d59d401595390 Mon Sep 17 00:00:00 2001 From: ddCat <2695092045@qq.com> Date: Fri, 31 Jul 2026 15:54:02 +0800 Subject: [PATCH] =?UTF-8?q?fix(api):=20=E8=A7=86=E9=A2=91=E7=94=9F?= =?UTF-8?q?=E6=88=90=20-=20=E4=BF=AE=E6=AD=A3=20Video=20Generations=20?= =?UTF-8?q?=E6=97=B6=E9=95=BF=E5=AD=97=E6=AE=B5=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/internal/service/provider.go | 2 +- backend/internal/service/provider_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/internal/service/provider.go b/backend/internal/service/provider.go index 98b157bbc..6b8905674 100644 --- a/backend/internal/service/provider.go +++ b/backend/internal/service/provider.go @@ -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), diff --git a/backend/internal/service/provider_test.go b/backend/internal/service/provider_test.go index 2f1293be8..6c108aa4e 100644 --- a/backend/internal/service/provider_test.go +++ b/backend/internal/service/provider_test.go @@ -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{})