Skip to content

feat(tools): add music_generate tool via MiniMax - #267

Open
octo-patch wants to merge 1 commit into
EverMind-AI:mainfrom
octo-patch:octo/20260804-music-generation-tool-recvrehXAHffUr
Open

feat(tools): add music_generate tool via MiniMax#267
octo-patch wants to merge 1 commit into
EverMind-AI:mainfrom
octo-patch:octo/20260804-music-generation-tool-recvrehXAHffUr

Conversation

@octo-patch

Copy link
Copy Markdown

Reason: Add a music_generate tool backed by the MiniMax /music_generation endpoint for global and China regions.

Changes

  • Add MusicGenerateTool to the media tool registry (raven/agent/tools/media_gen.py): one synchronous POST to {api_base}/music_generation, with url and hex output formats, cover reference audio (audio_url / audio_base64), streamed hex chunks, and the optional aigc_watermark field required on the China endpoint.
  • Default model is music-3.0; the model parameter 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).
  • Response parsing follows base_resp.status_code (0 = success), data.status (2 = ready), and data.audio (hex payload or downloadable URL list).
  • Add tools.media.music to MediaGenConfig and resolve its API key from the minimax provider config as a fallback in effective_media_config.
  • Register the tool in AgentLoop._register_default_tools when tools.media.music has a key or model.
  • Add hermetic unit tests (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 passed
  • ruff check on the changed files -> All checks passed
  • ruff format --check on the changed files -> 5 files already formatted

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant