Add Volcengine Jimeng (即梦 AI) video provider with V4 signing#341
Open
yiyabo wants to merge 2 commits into
Open
Add Volcengine Jimeng (即梦 AI) video provider with V4 signing#341yiyabo wants to merge 2 commits into
yiyabo wants to merge 2 commits into
Conversation
Implements the Jimeng/Volcengine part of issue calesthio#249, as agreed with @xucailiang (who is handling the Kling provider separately). Adds a first-class Jimeng video provider that calls the Volcengine visual API directly (visual.volcengineapi.com) using HMAC-SHA256 V4 request signing with IAM AK/SK credentials. This is the first provider in OpenMontage to use V4 signing (all others use Bearer token auth). API flow: POST CVSync2AsyncSubmitTask -> poll CVSync2AsyncGetResult -> download video_url. Features: - Text-to-video and image-to-video (Jimeng 3.0 Pro) - Configurable frame count (121=5s, 241=10s at 24fps) - Aspect ratio selection (16:9, 9:16, 1:1, etc.) - Seed for reproducibility - Full V4 HMAC-SHA256 request signing (not Bearer token) - Error handling with Jimeng code 10000 success convention - API key redaction in error messages (both env vars, no empty-string bug) Env vars: VOLC_ACCESSKEY + VOLC_SECRETKEY (IAM AK/SK pair). Idempotency keys include all output-affecting fields. Files: - tools/video/jimeng_video.py — new tool (V4 signing + submit/poll/download) - tests/contracts/test_jimeng_video.py — 46 contract tests (no AK/SK needed) - .env.example — VOLC_ACCESSKEY + VOLC_SECRETKEY - docs/PROVIDERS.md — Volcengine Jimeng provider section End-to-end tested with real Volcengine IAM credentials: generated a 1920x1088 H.264 5.04s video, ffprobe verified. Test results: python -m pytest tests/contracts/test_jimeng_video.py -q # 46 passed
There was a problem hiding this comment.
Pull request overview
This PR adds a new first-class video generation provider integration for Volcengine Jimeng (即梦 AI) by implementing Volcengine IAM V4 HMAC-SHA256 request signing (AK/SK), with submit→poll→download flow and contract coverage.
Changes:
- Introduces
jimeng_videotool using Volcengine Visual API with V4 signing, supporting text-to-video and image-to-video. - Adds contract tests to validate BaseTool compliance without requiring real credentials or network calls.
- Updates provider documentation and
.env.examplewith Volcengine AK/SK environment variables.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
tools/video/jimeng_video.py |
New Jimeng provider tool: V4 signing, submit/poll/download, output probing, redaction, cost/runtime estimates |
tests/contracts/test_jimeng_video.py |
Contract tests for discovery, schema, idempotency fields, and helper behavior |
docs/PROVIDERS.md |
Adds Volcengine Jimeng provider setup + API notes + pricing note |
.env.example |
Adds VOLC_ACCESSKEY / VOLC_SECRETKEY sample entries |
| "Chinese-language prompt understanding", | ||
| ] | ||
| not_good_for = ["offline generation", "users without Volcengine AK/SK"] | ||
| fallback_tools = ["minimax_tokenplan_video", "kling_video", "veo_video"] |
Comment on lines
+141
to
+148
| idempotency_key_fields = [ | ||
| "prompt", | ||
| "operation", | ||
| "image_url", | ||
| "frames", | ||
| "aspect_ratio", | ||
| "seed", | ||
| ] |
Comment on lines
+62
to
+65
| def test_has_fallbacks(self): | ||
| tool = JimengVideo() | ||
| assert "minimax_tokenplan_video" in tool.fallback_tools | ||
| assert "kling_video" in tool.fallback_tools |
minimax_tokenplan_video does not exist in main branch (added in PR calesthio#297, not yet merged). Use minimax_video which is the existing tool. Fixes Copilot review comments on fallback_tools reference and contract test assertion.
accesgranet-sketch
approved these changes
Jul 10, 2026
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.
Implements the Jimeng/Volcengine part of #249, as agreed with @xucailiang (who is handling the Kling provider separately).
@calesthio — this is my third provider integration PR (after #240 DashScope, merged; #297 MiniMax Token Plan, in review). This is the first provider in OpenMontage to use Volcengine IAM V4 HMAC-SHA256 request signing instead of Bearer token auth.
What this adds
A new tool
jimeng_videothat calls the Volcengine visual API (visual.volcengineapi.com) directly with AK/SK credentials, supporting text-to-video and image-to-video via Jimeng 3.0 Pro.API flow:
POST ?Action=CVSync2AsyncSubmitTask→ pollPOST ?Action=CVSync2AsyncGetResult→ downloadvideo_urlAuthentication
All other OpenMontage providers use Bearer token auth (one API key in a header). Volcengine IAM requires HMAC-SHA256 V4 request signing — each request is individually signed with a derived key (SK → date → region → service → "request"). This is the first provider in OpenMontage to implement V4 signing.
Features
_json_or_raiseand_check_codehelpers (consistent with Add MiniMax official Token Plan video provider (direct API, not FAL) #297 patterns)End-to-end tested
Generated a real video with Volcengine IAM credentials:
Files
tools/video/jimeng_video.pytests/contracts/test_jimeng_video.py.env.exampleVOLC_ACCESSKEY+VOLC_SECRETKEYdocs/PROVIDERS.mdTest results
Idempotency keys include all output-affecting fields (prompt, operation, image_url, frames, aspect_ratio, seed). Execution-only fields (output_path, poll_interval_seconds, timeout_seconds) are correctly excluded.
Closes the Jimeng part of #249.