ac4af582301a4e8a29245dbba767eba31334ddf9
1
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
b2034c1bcf |
gateway: an Ark video keeps the caller's content, ratio and own fields, and answers Ark's
axelburks on Discord listed what /v1/videos did to a Seedance request
against Ark's own API (docs 82379/1520757 create, 1521309 query). Each
item checked against those docs and video.go; the real ones:
- A caller's content was overwritten. volcengineVideoBody built content
from the prompt and OpenAI's image fields and set it over the caller's,
so reference_video, reference_audio and draft_task items were lost.
Now a content sent is Ark's own and kept whole; the prompt goes first
only when it has no text item, OpenAI's image fields after it.
- Image-to-video needed a prompt; asset:// and seconds -1 were refused.
Ark's image-to-video takes no prompt, its asset library's asset://
ids are images, and duration -1 lets the model choose. Now the prompt
is optional with an image or a content, asset:// is kept as it is, and
-1 goes as -1. These three are Ark's alone: arkOnly turns them away
with a 400 before another vendor (MiniMax, Grok, an OpenAI-compatible
one) is asked.
- size overrode an explicit ratio/resolution, and its mapping was wrong.
size went through to ratio and resolution after the caller's own were
copied, so ratio "adaptive" was lost; its resolutions stopped at 1080p
and its ratios were Grok's, without 21:9 (3840x2160 went as 1080p). Now a ratio, resolution
or duration the caller sends is never overridden; size is the nearest
of Ark's tiers by pixels (480p, 720p, 1080p, 4k) and of Ark's
ratios (arkVideoSize).
- Every string field, a JSON body's too, was read as JSON when it parsed
as a bool or a number, and nothing else was: a form's tools stayed the
string "[{...}]", and safety_identifier "12345" became 12345. Now only a
multipart form's values are parsed (formValue), and Ark's text fields
(arkTextFields: safety_identifier, callback_url, service_tier, ratio, …) stay strings. A
JSON body's values keep their JSON types.
- The query answer dropped Ark's extras. Now every field of Ark's task
that OpenAI's video object doesn't have (content.last_frame_url, usage,
resolution, ratio, framespersecond, seed, tools, output_format, …) is
passed on as it came (videoState.Ark, all but arkOwnFields).
- A MOV was served as mp4. /content now reads the ftyp brand ("qt " is
video/quicktime), then the vendor's video/* type, then Ark's
output_format; mp4 only when none says otherwise (videoType).
- The expired message was wrong: Ark's expired is a task that ran past
its execution_expires_after (48h by default) unfinished, not a link
that expired. It now says so.
Not real: watermark is not forced on videos (it went as sent already).
Tests (internal/gateway/ark_video_fields_test.go):
TestArkVideoKeepsCallersContent, TestArkVideoFromImageNeedsNoPrompt,
TestOnlyArkTakesItsOwnVideoAsks, TestArkVideoSize,
TestArkVideoFieldTypes, TestArkVideoAnswersItsOwnFields, TestVideoType.
Docs: gateway-routing.md's Ark video paragraph and /content row.
Run on mote at the head of this stack (the Ark video fields, the native
route and the Ark image fields, three commits on
|