avoid mutable default constructor values

This commit is contained in:
Aleix Conchillo Flaqué
2025-05-20 11:59:04 -07:00
parent 462aecea3e
commit a09bd648af
51 changed files with 209 additions and 124 deletions

View File

@@ -34,7 +34,7 @@ class GroqTTSService(TTSService):
*,
api_key: str,
output_format: str = "wav",
params: InputParams = InputParams(),
params: Optional[InputParams] = None,
model_name: str = "playai-tts",
voice_id: str = "Celeste-PlayAI",
sample_rate: Optional[int] = GROQ_SAMPLE_RATE,
@@ -42,12 +42,15 @@ class GroqTTSService(TTSService):
):
if sample_rate != self.GROQ_SAMPLE_RATE:
logger.warning(f"Groq TTS only supports {self.GROQ_SAMPLE_RATE}Hz sample rate. ")
super().__init__(
pause_frame_processing=True,
sample_rate=sample_rate,
**kwargs,
)
params = params or GroqTTSService.InputParams()
self._api_key = api_key
self._model_name = model_name
self._output_format = output_format