From f609f7eb5362743ffec374719fad0c21ea44a9f2 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Mon, 21 Jul 2025 21:16:35 -0400 Subject: [PATCH] fix: MiniMaxHttpTTSService pitch, add base_url arg --- CHANGELOG.md | 6 ++++++ src/pipecat/services/minimax/tts.py | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ed3fef89..7536b20de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Updated `MiniMaxHttpTTSService` with a `base_url` arg where you can specify + the Global endpoint (default) or Mainland China. + - Changed the `livekit` optional dependency for `tenacity` to `tenacity>=8.2.3,<10.0.0` in order to support the `google-genai` package. @@ -25,6 +28,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fixed an issue in `MiniMaxHttpTTSService` where the `pitch` param was the + incorrect type. + - Fixed an issue in `OLLamaLLMService` where kwargs were not passed correctly to the parent class. diff --git a/src/pipecat/services/minimax/tts.py b/src/pipecat/services/minimax/tts.py index 4faf88b1c..cd63fe761 100644 --- a/src/pipecat/services/minimax/tts.py +++ b/src/pipecat/services/minimax/tts.py @@ -109,7 +109,7 @@ class MiniMaxHttpTTSService(TTSService): language: Optional[Language] = Language.EN speed: Optional[float] = 1.0 volume: Optional[float] = 1.0 - pitch: Optional[float] = 0 + pitch: Optional[int] = 0 emotion: Optional[str] = None english_normalization: Optional[bool] = None @@ -117,6 +117,7 @@ class MiniMaxHttpTTSService(TTSService): self, *, api_key: str, + base_url: str = "https://api.minimax.io/v1/t2a_v2", group_id: str, model: str = "speech-02-turbo", voice_id: str = "Calm_Woman", @@ -129,6 +130,9 @@ class MiniMaxHttpTTSService(TTSService): Args: api_key: MiniMax API key for authentication. + base_url: API base URL, defaults to MiniMax's T2A endpoint. + Global: https://api.minimax.io/v1/t2a_v2 + Mainland China: https://api.minimaxi.chat/v1/t2a_v2 group_id: MiniMax Group ID to identify project. model: TTS model name. Defaults to "speech-02-turbo". Options include "speech-02-hd", "speech-02-turbo", "speech-01-hd", "speech-01-turbo". @@ -144,7 +148,7 @@ class MiniMaxHttpTTSService(TTSService): self._api_key = api_key self._group_id = group_id - self._base_url = f"https://api.minimaxi.chat/v1/t2a_v2?GroupId={group_id}" + self._base_url = f"{base_url}?GroupId={group_id}" self._session = aiohttp_session self._model_name = model self._voice_id = voice_id