Add MiniMax music generation tool - #290
Open
octo-patch wants to merge 2 commits into
Open
Conversation
Add a music generation tool backed by the MiniMax /v1/music_generation endpoint for both the global (api.minimax.io) and CN (api.minimaxi.com) regions. The new MiniMaxMusicProvider builds requests for generation (music-3.0, music-2.6 and free variants) and cover (music-cover and music-cover-free) models, supports url/hex output and the aigc_watermark field on the CN endpoint, and parses base_resp.status_code with data.status/data.audio. The tool is registered in TOOL_MAPPING under the minimax provider and the minimax provider preset is added to the default provider config. Unit tests cover endpoint building, region detection, payload building, validation and response parsing. Co-Authored-By: Claude <noreply@anthropic.com>
Author
|
I updated the MiniMax music tool to expose streaming, enforce generation and cover input constraints, and validate audio formats. I ran the focused provider tests (18 passed), Ruff, Black, compileall, and a tool-schema check. |
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.
Reason: Add MiniMax music generation tool wiring the /v1/music_generation endpoint for global and CN regions
Changes
server/tools/music_providers/minimax_provider.py: a music generation provider that posts to the/v1/music_generationendpoint for both the global (api.minimax.io) and CN (api.minimaxi.com) regions. It supports generation models (music-3.0,music-2.6and free variants) and cover models (music-cover,music-cover-free), the request fieldsprompt,lyrics,stream,output_format,audio_setting,lyrics_optimizer,is_instrumental,audio_url,audio_base64,cover_feature_idand the CN-onlyaigc_watermark,url/hexoutput formats, and response parsing viabase_resp.status_codewithdata.status/data.audio.server/tools/generate_music_by_minimax_jaaz.py: the langchain toolgenerate_music_by_minimax_jaaz.server/services/tool_service.pyunder theminimaxprovider.minimaxprovider preset with its music models toserver/services/config_service.py.server/models/config_model.pyandserver/services/config_service.pyto includemusic.server/tests/test_minimax_music_provider.pycovering endpoint building, region detection, payload building, request validation and response parsing.Checks
python -m pytest tests/test_minimax_music_provider.py -q(run fromserver/) — 15 passedpython -m ruff checkon the new/changed files — clean for the new filespython -m py_compileon all changed files — ok