Spinning out a follow-up flagged in PR #409 review (#409 (comment)).
The current validateVideoSeconds hook in OpenAICompatibleVideoAdapter (and concrete subclasses like OpenAIVideoAdapter) treats seconds as a number | string runtime value but the type system doesn't enforce the per-model literals each provider actually accepts.
We really need to change the duration validation. Many models support strings like "6s" instead of the number 6. Some take the string "auto". The duration thing is one of the hardest parts of doing video... it's as hard as the sizes in images. I'll add an issue for it. I think duration needs to be a template type, but we might also want to think about creating a snapDuration method. — @tombeckenham
Scope
Out of scope for this issue
Memory bounding for downloaded video buffers — see the separate "large media uploader" follow-up.
cc @tombeckenham
Spinning out a follow-up flagged in PR #409 review (#409 (comment)).
The current
validateVideoSecondshook inOpenAICompatibleVideoAdapter(and concrete subclasses likeOpenAIVideoAdapter) treatssecondsas anumber | stringruntime value but the type system doesn't enforce the per-model literals each provider actually accepts.Scope
durationa template-literal-driven type so per-model duration unions are surfaced at compile time (mirroring theOpenAIVideoModelSizeByName/sizepattern already used for image dimensions).snapDurationhelper that maps user-supplied durations (number,\"6s\",\"auto\", etc.) to the value the provider actually wants — symmetrically with how some image providers want a string and some a number.model-meta.Out of scope for this issue
Memory bounding for downloaded video buffers — see the separate "large media uploader" follow-up.
cc @tombeckenham