feat(tts): add MiniMax as a TTS provider#44716
Conversation
Greptile SummaryThis PR adds MiniMax T2A V2 as a fourth TTS provider. The implementation is largely well-structured — config types, Zod validation, directive parsing, and the core
Confidence Score: 2/5
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 307f981ecc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Adds MiniMax (https://api.minimax.chat) as a first-class TTS provider alongside ElevenLabs, OpenAI, and Edge TTS. - `TtsProvider` union extended with `"minimax"` - `messages.tts.minimax` config block: apiKey, model, voice, speed, vol, sampleRate - `MINIMAX_API_KEY` env var picked up automatically (same pattern as ELEVENLABS_API_KEY / OPENAI_API_KEY) - Auto-detection: minimax is selected when only its API key is present (priority: openai > elevenlabs > minimax > edge) - `minimaxTTS()` in tts-core.ts calls the `/v1/t2a_v2` endpoint and decodes the hex-encoded MP3 from the response - Per-reply voice/model overrides via `TtsDirectiveOverrides.minimax` - `tts.providers` gateway response lists minimax with its two models - `tts.setProvider` accepts `"minimax"` - `tts.status` exposes `hasMiniMaxKey` - 3 new unit tests in tts.test.ts covering defaults, env key pickup, and config overrides Defaults: model=speech-02-hd, voice=male-qn-qingse, sampleRate=32000 Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…rmat Follow-up to the initial MiniMax provider addition: Config (`messages.tts.minimax`): - Add `pitch` (−12–12 semitones, default 0) - Add `emotion` (happy/sad/angry/fearful/disgusted/surprised/calm/fluent/whisper) - Add `outputFormat` (mp3/pcm/flac/wav, default "mp3") — no longer hard-coded - Fix `vol` Zod validation to (0, 10] per API spec (was 0.5–2.0) - Update default model to `speech-02-hd` (alias for latest speech-2.x series) Directive system (`[[tts:...]]`): - `provider=minimax` now accepted when `allowProvider` is enabled - `minimax_voice=<id>` — set voice per reply (`allowVoice` gate) - `minimax_voice_id=<id>` — alias for minimax_voice - `minimax_emotion=<value>` — set emotion per reply (`allowVoiceSettings` gate); invalid values produce a warning and are ignored API correctness: - `bitrate` is only sent for mp3 (not pcm/flac/wav) - `emotion` is omitted from the request body when not set - File extension derived from `outputFormat` (`.mp3/.pcm/.flac/.wav`) - `voiceCompatible` always false for MiniMax (no opus support) Gateway: `tts.providers` lists speech-2.8-hd/turbo and speech-2.6-hd/turbo Tests: 5 new cases covering minimax provider directive, minimax_voice, minimax_emotion (valid and invalid), totalling 47 tests passing. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
speech-02-hd is an alias that may not always point to the latest model; use the explicit speech-2.8-hd version instead. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
- Fix vol JSDoc to say '>0-10' (strictly positive, matching Zod .positive()) - Exclude MiniMax from textToSpeechTelephony fallback chain; MiniMax does not implement telephony PCM output and would otherwise fall through to the OpenAI branch with the wrong API key
e882b82 to
7896d55
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7896d550b3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| export const TTS_PROVIDERS = ["openai", "elevenlabs", "edge"] as const; | ||
| export const TTS_PROVIDERS = ["openai", "elevenlabs", "minimax", "edge"] as const; |
There was a problem hiding this comment.
Sync chat
/tts provider command with new provider list
After adding minimax to the global provider order, the in-chat control surface still hardcodes openai|elevenlabs|edge and rejects /tts provider minimax in handleTtsCommands (src/auto-reply/reply/commands-tts.ts). That means users who manage TTS via chat commands cannot select the newly added provider even though the backend now supports it, so the feature is only partially reachable depending on which interface they use.
Useful? React with 👍 / 👎.
|
Closing as superseded by the landed MiniMax speech-provider implementation on current main. MiniMax TTS is already in-tree through the bundled MiniMax plugin path:
That landed on the extension-owned/provider-owned surface rather than the older core Thanks for putting this together. |
Summary
Adds MiniMax T2A V2 as a fourth TTS provider alongside OpenAI, ElevenLabs, and Edge TTS.
"minimax"POST https://api.minimax.chat/v1/t2a_v2MINIMAX_API_KEYenv var ortts.minimax.apiKeyconfigspeech-2.8-hdmale-qn-qingse[[tts:provider=minimax]],[[tts:minimax_voice=<id>]],[[tts:minimax_emotion=<value>]]happy/sad/angry/fearful/disgusted/surprised/calm/fluent/whispermodel,voice,speed(0.5-2.0),vol(0-10],pitch(-12 to 12),emotion,outputFormat(mp3/pcm/flac/wav),sampleRateChanges
src/config/types.tts.ts— extendTtsProviderunion; addminimaxconfig blocksrc/config/zod-schema.core.ts— add MiniMax Zod validationsrc/tts/tts-core.ts— implementminimaxTTS(); add directivessrc/tts/tts.ts— wire MiniMax into provider loop and config resolutionsrc/gateway/server-methods/tts.ts— exposehasMiniMaxKeyand provider listsrc/tts/tts.test.ts— unit tests for config defaults, env key, directivesTest plan
pnpm test src/tts/tts.test.ts— all tests passMINIMAX_API_KEYand runtts.convertvia gateway