feat: video_analysis resource and CLI command (0.14.0 / cli 0.13.0) - #30
Merged
Conversation
Propagates POST /v1/video-analysis to the SDK and the CLI. video-analysis is the first Sonilo product whose result is not media: it generates nothing and there is no file to download. The result is a work order — a time-aligned `segments` plan plus one `prompt` per requested variation, each ready to hand straight to video_to_music, video_to_sfx, video_to_sound or their video-to-video counterparts. That shapes the surface in two places: - The resource method is `analyze()`, not `generate()`, and VideoAnalysisResult has no `save()`. Every other resource returns something you download; this one never does, so persisting the brief is the caller's business. - The CLI prints the brief to stdout as JSON so it can be piped into the next command, and writes a file only when `--output` asks for one. Every other command's default is a media file on disk. Both list fields are coerced entry-by-entry and malformed entries dropped, for the same reason parse_dubbing_result coerces `outputs`: a differently-shaped entry from a later backend change should surface as a missing item, not an AttributeError deep in the caller's loop. The 1-5 variants_num bound and the 2000-char prompt bound are deliberately not re-checked client-side — the backend owns them, and a hardcoded copy would make this SDK reject values a later API widens. sonilo-cli's narrow pin on the core moves to >=0.14.0,<0.15 with the bump.
Lightsage docs evalsWaiting for the staging docs URL before running evals. Lightsage will start the selected PR evals automatically when GitHub reports a successful docs deployment for this PR. This usually happens within 15 minutes. Commit: |
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.
Propagates
POST /v1/video-analysisto the Python SDK and the CLI.What's new
client.video_analysis.submit()/.analyze()(plus the async twins), taking exactly one ofvideo/video_urlplus optionalpromptandvariants_num.VideoAnalysisResult,AnalysisSegment,AnalysisVariationtypes, andparse_video_analysis_resultfor callers who polltasks.waitthemselves.sonilo video-analysis --video clip.mp4 --prompt ... --variants 2.Why the surface differs from every other endpoint
video-analysis is the first Sonilo product whose result is not media: it generates nothing and there is no file to download. The result is a work order — a time-aligned
segmentsplan plus onepromptper requested variation, each ready to hand straight tovideo_to_music,video_to_sfx,video_to_soundor their video-to-video counterparts.So:
analyze(), notgenerate(), andVideoAnalysisResulthas nosave()— persisting the brief is the caller's business;--outputasks for one.Notes
parse_dubbing_resultcoercesoutputs.variants_numbound and the 2000-charpromptbound are not re-checked client-side; the backend owns them.sonilo-cli's narrow pin on the core moves to>=0.14.0,<0.15.Testing
pytest(268),pytest sonilo-cli(149),pytest sonilo-video-kit(53) — all green. 15 new tests cover the parser, the request builder, file upload, polling, and every CLI path.