fix: MiniMaxHttpTTSService pitch, add base_url arg

This commit is contained in:
Mark Backman
2025-07-21 21:16:35 -04:00
parent ea09813a2b
commit f609f7eb53
2 changed files with 12 additions and 2 deletions

View File

@@ -17,6 +17,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### 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 - Changed the `livekit` optional dependency for `tenacity` to
`tenacity>=8.2.3,<10.0.0` in order to support the `google-genai` package. `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
- Fixed an issue in `MiniMaxHttpTTSService` where the `pitch` param was the
incorrect type.
- Fixed an issue in `OLLamaLLMService` where kwargs were not passed correctly - Fixed an issue in `OLLamaLLMService` where kwargs were not passed correctly
to the parent class. to the parent class.

View File

@@ -109,7 +109,7 @@ class MiniMaxHttpTTSService(TTSService):
language: Optional[Language] = Language.EN language: Optional[Language] = Language.EN
speed: Optional[float] = 1.0 speed: Optional[float] = 1.0
volume: Optional[float] = 1.0 volume: Optional[float] = 1.0
pitch: Optional[float] = 0 pitch: Optional[int] = 0
emotion: Optional[str] = None emotion: Optional[str] = None
english_normalization: Optional[bool] = None english_normalization: Optional[bool] = None
@@ -117,6 +117,7 @@ class MiniMaxHttpTTSService(TTSService):
self, self,
*, *,
api_key: str, api_key: str,
base_url: str = "https://api.minimax.io/v1/t2a_v2",
group_id: str, group_id: str,
model: str = "speech-02-turbo", model: str = "speech-02-turbo",
voice_id: str = "Calm_Woman", voice_id: str = "Calm_Woman",
@@ -129,6 +130,9 @@ class MiniMaxHttpTTSService(TTSService):
Args: Args:
api_key: MiniMax API key for authentication. 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. group_id: MiniMax Group ID to identify project.
model: TTS model name. Defaults to "speech-02-turbo". Options include model: TTS model name. Defaults to "speech-02-turbo". Options include
"speech-02-hd", "speech-02-turbo", "speech-01-hd", "speech-01-turbo". "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._api_key = api_key
self._group_id = group_id 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._session = aiohttp_session
self._model_name = model self._model_name = model
self._voice_id = voice_id self._voice_id = voice_id