Add MiniMax text-to-speech API tool for global and CN endpoints - #15
Open
octo-patch wants to merge 1 commit into
Open
Add MiniMax text-to-speech API tool for global and CN endpoints#15octo-patch wants to merge 1 commit into
octo-patch wants to merge 1 commit into
Conversation
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. |
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 MiniMax text-to-speech API tool exposing both the global (api.minimax.io) and China (api.minimaxi.com) T2A endpoints.
Changes:
api.py: addminimax_tts_api(prompt, ...), which posts to the MiniMax/v1/t2a_v2text-to-audio endpoint. It selects the regional base URL via theregionargument (global_enorcn_zh), sendsmodel,text,stream, andoutput_format, decodes the hex audio payload returned indata.audio, verifiesbase_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-exportminimax_tts_apifromapiso it is available to the Agent toolchain.gte.py: add a MiniMax T2A code snippet to the API retrieval list used byget_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_coderesponse shape) are sourced from the task's multimodalspeechconfiguration.