Repository navigation
feat(sfx): add the VideoToSFX tool that scores a video through the gateway - #1843
Merged
Merged
Conversation
v1.46.0 syncs the generated types with schemas v1.13.2 and documents the video scoring fields on CreateSFXRequest together with the Mirelo provider.
…teway Adds the VideoToSFX agent tool over the gateway's POST /v1/audio/sfx multipart form: a clip from the working directory or the TextToVideo output directory is uploaded as the video part and the answered track is saved with the extension the response content type carries, with prompt, seconds, start_seconds, track, preserve_speech and output_path guiding or confining the request. The tool ships disabled behind video_to_sfx.enabled because the clip is uploaded to a third party, and while it is disabled the definition is not sent to the LLM. The request deadline covers the upload plus the gateway's 150 s scoring budget, a 413 names SERVER_MAX_REQUEST_BODY_SIZE, and other failures pass the gateway's own message through.
6 tasks
inference-gateway-maintainer
Bot
marked this pull request as ready for review
November 15, 2026 01:37
inference-gateway-maintainer
Bot
requested a review
from a team
as a code owner
November 15, 2026 01:37
The service removed the resolved output path whenever the answered track carried another extension. That is right for the empty timestamped placeholder, but it also deleted an earlier track when the caller named the output. The tool now owns all placeholder cleanup and removes it only when it allocated one. Also stream the clip into the multipart form instead of holding it twice in memory, list VideoToSFX on the sfx media shelf in the directory docs, and bring the new doc comments and tests in line with AGENTS.md.
5 tasks
The scored track was a bare string checked against literals in the tool. It is now the domain's SoundEffectTrack with a catalog and Valid, and the manifest offers the same values as a JSON schema enum. The rest of the new code drops its literals too: the multipart form fields, the route and provider query parameter, the argument names, the shortest scored window, the output file prefix and default extension, the media type to extension table and the sfx media shelf. The model id is split with the existing config.ParseModel.
The domain declared its own SoundEffectTrack with the same three values the SDK already generates as CreateSFXRequestOutput, Valid included. The request now carries the SDK type and the duplicate enum, its catalog and its Valid method are gone.
edenreich
added a commit
that referenced
this pull request
Nov 15, 2026
…s API (#1844) Resolves #1840 ## Summary Adds the DubVideo agent tool: a Mirelo model dub of an existing clip through the gateway's Videos API. The tool posts the multipart create to POST /v1/videos, polls the job with the TextToVideo polling code and its timeout and poll_interval knobs, and downloads the finished MP4 from /content. It is registered only when both video_to_sfx.enabled and video_to_sfx.dub are true - the switch pattern CreateAvatar uses under text_to_video - and its description states Mirelo's limit that only the generated mix is laid onto the clip, so it offers no track parameter. The video_to_sfx block itself landed on main with the VideoToSFX tool (#1843) while this PR was open. This PR now adds only the dub switch to it, so video_to_sfx.enabled registers VideoToSFX as on main and DubVideo needs enabled and dub together. The SDK (v1.46.0) carries the dubbing fields in CreateVideoRequest but its hand-written CreateVideo encoder drops them, so the dub create rides a small CLI-side gateway (agentinfra.DubGateway) that posts the same multipart form with bearer auth and provider routing. The SDK client keeps covering retrieve and content download, and go.mod ends this PR byte-identical to main. ## Changes - config: a dub switch on the existing video_to_sfx block, next to enabled, model, output_dir and require_approval - agent domain: VideoDubRequest and a Dub method on the VideoService interface - agent infrastructure: Dub creates the job through the injected DubGateway (multipart create with the video part and preserve_speech), then shares TextToVideo's finishVideoJob (poll, download, write). The clip is checked against the gateway's 10 MiB body limit before sending - container: wires DubGateway from the gatewayEndpoint that VideoToSFX already uses (base URL, bearer key and the propagated gateway transport) - gateway supervisor: the auto-started gateway also gets VIDEOS_ENABLED=true while the dub switch is on - tools: DubVideo.yaml manifest, DubVideoTool (video looked up in the working directory, then the TextToVideo output directory, bare output_path into text_to_video.output_dir), ToolDubVideo constant, registry gating, the videoExtensions list shared with VideoToSFX, and the golden tool definitions snapshot (52 tools) - tests: a whitespace-trimming case and a table-driven validation test in the video_to_sfx config tests, infrastructure Dub tests against a stubbed Videos API, tool unit and registry tests, and a full-loop integration test (DubVideoToolAgainstMockGateway) - docs: DubVideo row and section in tools-reference.md, a Dubbing section in text-to-video.md, and the dub key and INFER_VIDEO_TO_SFX_DUB in the video_to_sfx section of configuration-reference.md, which now covers both tools ## Downstream impact - inference-gateway/sdk: CreateVideo drops the video part and preserve_speech/start_offset_seconds that schemas v1.14.0 added (sync PR inference-gateway/sdk#253 regenerated the types only) - filed inference-gateway/sdk#254. Once a release forwards these fields, the CLI can route the dub create back through sdk.Client.CreateVideo and retire the small gateway. - inference-gateway/gateway: dubbing shipped in v0.66.0 and nothing is needed there beyond VIDEOS_ENABLED=true, which the CLI now sets for the auto-started gateway while the dub switch is on. - docs site ticket: inference-gateway/docs#1219 (the in-repo docs are already part of this PR). --------- Co-authored-by: inference-gateway-maintainer[bot] <246577062+inference-gateway-maintainer[bot]@users.noreply.github.com> Co-authored-by: Eden Reich <[email protected]>
Contributor
|
🎉 This PR is included in version 0.262.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #1839
Summary
Adds the VideoToSFX agent tool: the chat model hands a clip from the working directory (or the TextToVideo output directory) to the gateway's POST /v1/audio/sfx as a multipart/form-data body with a video part, and the answered track is saved with the extension the response content type carries. Like TextToSFX and TextToVideo it holds no provider key (the gateway does), and it stays disabled until video_to_sfx.enabled is true because the user's footage is uploaded to a third party. While video_to_sfx.enabled is false the tool definition is not sent to the LLM at all.
Changes
Downstream