Add MiniMax music generation provider#789
Conversation
santoshkumarradha
left a comment
There was a problem hiding this comment.
Thanks for the contribution. The provider wiring is straightforward, but there’s one SDK contract break that needs fixing before this is safe to merge.
Please also add tests for the new music path, especially the output_format="url" and output_format="hex" branches. Right now the PR description mentions local checks, but there is no repo test coverage for this provider yet.
Separately, the CLA check is still pending, so that will need to be signed before we can merge.
| if response.status >= 400 or data.get("base_resp", {}).get("status_code") != 0: | ||
| raise RuntimeError(f"MiniMax music generation failed ({response.status}): {data}") | ||
| audio = data.get("data", {}).get("audio") | ||
| output = AudioOutput(data=audio if audio and body["output_format"] == "hex" else None, format=body.get("audio_setting", {}).get("format", "mp3"), url=audio if body["output_format"] == "url" else None) |
There was a problem hiding this comment.
AudioOutput.data is base64-encoded audio bytes everywhere else in the SDK, but this branch stores MiniMax's raw hex string directly. That means helpers like AudioOutput.get_bytes() and .save() will try to base64-decode hex and produce the wrong bytes or fail.
Can we decode the hex payload to bytes here and then re-encode it as base64 before constructing AudioOutput?
Reason: Add MiniMax music generation to the media provider registry.
Implemented global and China endpoint routing, Bearer authentication, request controls, output formats, and response parsing for MiniMax music generation.
Checks: python3 -m py_compile sdk/python/agentfield/media_providers.py; PYTHONPATH=sdk/python pytest -q sdk/python/tests/test_media_providers.py -q