feat(python-sdk): add OpenRouter video generation via async polling (#464)#479
Merged
santoshkumarradha merged 3 commits intodev/add-videofrom Apr 18, 2026
Merged
Conversation
) CR-01: Add image_url to request body (was silently dropped) CR-02: Validate job_id format + enforce HTTPS-only video download URL HI-01: Add MAX_VIDEO_BYTES (500MB) size limit on video downloads HI-02: Add comment clarifying download uses no auth headers HI-03: Add transient poll error retry (max 3 consecutive 502/503/504) MD-01: Fix duration type to Optional[float], remove int() cast in agent_ai MD-03: Move poll sleep to end of loop (poll immediately on first iteration) LO-01: Truncate error response bodies to 500 chars LO-02: Move _error_messages to class constant _VIDEO_ERROR_MESSAGES IN-02: Add test for image_url passthrough in request body
Resolve conflicts from merging dev/add-video (which includes audio/music #465, Go SDK #468, TS SDK #467) into the video generation branch: - Combine supported_modalities: ["image", "video", "audio", "music"] - Use MediaRouter for video routing (from #463) instead of manual prefix checks - Remove duplicate VideoOutput class (keep richer version with resolution/aspect_ratio) - Standardize has_videos property name (plural, consistent with has_images/has_files) - Update test error message assertions to match MediaRouter's ValueError
Contributor
Performance
✓ No regressions detected |
Contributor
📊 Coverage gateThresholds from
✅ Gate passedNo surface regressed past the allowed threshold and the aggregate stayed above the floor. |
Contributor
📐 Patch coverage gateThreshold: 80% on lines this PR touches vs
❌ Patch gate failed
How to fix
|
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.
Summary
OpenRouterProvider.generate_video()with async polling workflow: POST submit -> poll until completed/failed -> download MP4VideoOutputmodel tomultimodal_response.pywith save/get_bytes supportvideosfield toMultimodalResponse(alongside existingfiles)openrouter/prefixed models inAgentAI.ai_generate_video()to OpenRouterProvidersupported_modalitiesto return["image", "video"]for OpenRouterTest plan