Skip to content

Add MiniMax music generation tool - #290

Open
octo-patch wants to merge 2 commits into
11cafe:mainfrom
octo-patch:octo/20260804-music-generation-tool-recvre8t8UELYG
Open

Add MiniMax music generation tool#290
octo-patch wants to merge 2 commits into
11cafe:mainfrom
octo-patch:octo/20260804-music-generation-tool-recvre8t8UELYG

Conversation

@octo-patch

Copy link
Copy Markdown

Reason: Add MiniMax music generation tool wiring the /v1/music_generation endpoint for global and CN regions

Changes

  • Added server/tools/music_providers/minimax_provider.py: a music generation provider that posts to the /v1/music_generation endpoint for both the global (api.minimax.io) and CN (api.minimaxi.com) regions. It supports generation models (music-3.0, music-2.6 and free variants) and cover models (music-cover, music-cover-free), the request fields prompt, lyrics, stream, output_format, audio_setting, lyrics_optimizer, is_instrumental, audio_url, audio_base64, cover_feature_id and the CN-only aigc_watermark, url/hex output formats, and response parsing via base_resp.status_code with data.status/data.audio.
  • Added server/tools/generate_music_by_minimax_jaaz.py: the langchain tool generate_music_by_minimax_jaaz.
  • Registered the tool in server/services/tool_service.py under the minimax provider.
  • Added the minimax provider preset with its music models to server/services/config_service.py.
  • Extended the model type literals in server/models/config_model.py and server/services/config_service.py to include music.
  • Added server/tests/test_minimax_music_provider.py covering endpoint building, region detection, payload building, request validation and response parsing.

Checks

  • python -m pytest tests/test_minimax_music_provider.py -q (run from server/) — 15 passed
  • python -m ruff check on the new/changed files — clean for the new files
  • python -m py_compile on all changed files — ok

octo-patch and others added 2 commits August 4, 2026 03:35
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>
@octo-patch

Copy link
Copy Markdown
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.

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