mirror of
https://github.com/calesthio/OpenMontage.git
synced 2026-08-05 23:24:27 +08:00
Implements the Jimeng/Volcengine part of issue #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