Skip to content

Add MiniMax text-to-speech API tool for global and CN endpoints - #15

Open
octo-patch wants to merge 1 commit into
JosefAlbers:mainfrom
octo-patch:octo/20260731-tts-tool-recvqhsUDatTIx
Open

Add MiniMax text-to-speech API tool for global and CN endpoints#15
octo-patch wants to merge 1 commit into
JosefAlbers:mainfrom
octo-patch:octo/20260731-tts-tool-recvqhsUDatTIx

Conversation

@octo-patch

Copy link
Copy Markdown

Reason: Add a MiniMax text-to-speech API tool exposing both the global (api.minimax.io) and China (api.minimaxi.com) T2A endpoints.

Changes:

  • api.py: add minimax_tts_api(prompt, ...), which posts to the MiniMax /v1/t2a_v2 text-to-audio endpoint. It selects the regional base URL via the region argument (global_en or cn_zh), sends model, text, stream, and output_format, decodes the hex audio payload returned in data.audio, verifies base_resp.status_code == 0, and writes the audio file to disk. The supported models and audio formats are listed as module constants.
  • phi_3_vision_mlx.py: re-export minimax_tts_api from api so it is available to the Agent toolchain.
  • gte.py: add a MiniMax T2A code snippet to the API retrieval list used by get_api, alongside the existing text-to-speech entry.
  • examples.py: add Agent toolchain examples exercising the global endpoint, the China endpoint, and an alternate MiniMax TTS model.

Checks:

  • python3 -m py_compile api.py gte.py examples.py (the shared environment runs Python 3.10; the full MLX test suite requires Python 3.12 and Apple silicon, so only the changed, import-light modules were syntax-checked here).

Target parameters (model list, default model, audio formats, regional URLs, required request fields, and the data.audio / base_resp.status_code response shape) are sourced from the task's multimodal speech configuration.

@JosefAlbers

Copy link
Copy Markdown
Owner

Thanks for the contribution! This looks reasonable, but I can't validate it locally without API keys. Could you run the change on your end and attach the command/output (or a screenshot) showing it works? Once there's evidence it's been tested, I'll take another look.

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.

2 participants