feat(tools): add music_generate tool via MiniMax - #267
Open
octo-patch wants to merge 1 commit into
Open
Conversation
Add a music_generate tool backed by the MiniMax /music_generation endpoint (api.minimax.io global, api.minimaxi.com for mainland China). It supports url and hex output formats, cover reference audio, streamed hex chunks, and parses the base_resp.status_code / data.status / data.audio response contract. The tool registers when tools.media.music is configured and falls back to the minimax provider API key. Co-authored-by: Claude (deepseek-v4-flash) <noreply@anthropic.com>
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 a music_generate tool backed by the MiniMax /music_generation endpoint for global and China regions.
Changes
MusicGenerateToolto the media tool registry (raven/agent/tools/media_gen.py): one synchronous POST to{api_base}/music_generation, withurlandhexoutput formats, cover reference audio (audio_url/audio_base64), streamed hex chunks, and the optionalaigc_watermarkfield required on the China endpoint.music-3.0; themodelparameter documents the generation models (music-3.0,music-2.6,music-3.0-free,music-2.6-free) and cover models (music-cover,music-cover-free).base_resp.status_code(0 = success),data.status(2 = ready), anddata.audio(hex payload or downloadable URL list).tools.media.musictoMediaGenConfigand resolve its API key from theminimaxprovider config as a fallback ineffective_media_config.AgentLoop._register_default_toolswhentools.media.musichas a key or model.tests/test_media_gen_music.py) covering url/hex output, the global and China endpoints, cover reference audio, streamed hex, and error parsing.Checks
pytest tests/test_media_gen_music.py tests/test_tool_registry_timeout.py tests/test_tool_search.py-> 47 passedruff checkon the changed files -> All checks passedruff format --checkon the changed files -> 5 files already formatted