Add MiniMax image generation support - #853
Conversation
Performance
✓ No regressions detected |
📊 Coverage gateThresholds from
✅ Gate passedNo surface regressed past the allowed threshold and the aggregate stayed above the floor. |
📐 Patch coverage gateThreshold: 80% on lines this PR touches vs
✅ Patch gate passedEvery surface whose lines were touched by this PR has patch coverage at or above the threshold. |
2024139 to
4a06417
Compare
AbirAbbas
left a comment
There was a problem hiding this comment.
Last of the three MiniMax PRs — took these over since they'd been quiet for a few days.
I found one real bug here. Response parsing read data.image_urls unconditionally, but MiniMax documents base64 responses under data.image_base64. So response_format="base64" — one of the two modes this PR advertises — would have failed against the real API every time with "returned no image_urls". The reason it looked fine is that the base64 test built its fixture with an image_urls payload, so it asserted the implementation's assumption rather than the provider's actual contract, and passed while masking the defect.
I've pushed a fix that selects the response key from the requested format and names the actual mode in the error, plus corrected the base64 fixture to the documented image_base64 shape. I confirmed it fails before the change and passes after.
Two smaller things in the same commit: base_resp and data were only type-checked at the top level, so a non-dict nested value leaked AttributeError instead of the normalized RuntimeError (#852 already did this properly, so I matched its idiom), and I added regression coverage for the branches that had none — empty model, HTTP status errors, non-dict JSON, missing and empty image collections.
On the test_minimax_video.py edit: I checked it isn't weakening video coverage. It only drops the obsolete generate_image NotImplementedError expectation, which this PR makes untrue.
Since this landed last of the three, I rebased it and reconciled the overlap with #852 and #854 by hand: supported_modalities is now the union ['video', 'music', 'audio', 'image'], the H3 constants and video_model_metadata from #854 are preserved, and both stale NotImplementedError assertions are gone. Full Python SDK suite is green on the reconciled result.
Reason: Add native MiniMax image generation support to the existing media provider pipeline.
Changes:
Checks:
git diff --check origin/main...HEAD