diff --git a/pyrightconfig.json b/pyrightconfig.json index 5483be730..8f6b951c6 100644 --- a/pyrightconfig.json +++ b/pyrightconfig.json @@ -42,7 +42,6 @@ "src/pipecat/services/azure/stt.py", "src/pipecat/services/azure/tts.py", "src/pipecat/services/cartesia/stt.py", - "src/pipecat/services/cartesia/tts.py", "src/pipecat/services/deepgram/flux/base.py", "src/pipecat/services/deepgram/flux/sagemaker/stt.py", "src/pipecat/services/deepgram/flux/stt.py", diff --git a/src/pipecat/services/cartesia/tts.py b/src/pipecat/services/cartesia/tts.py index 192d5dc90..f91fa90b5 100644 --- a/src/pipecat/services/cartesia/tts.py +++ b/src/pipecat/services/cartesia/tts.py @@ -916,6 +916,9 @@ class CartesiaHttpTTSService(TTSService): logger.debug(f"{self}: Generating TTS [{text}]") try: + if self._session is None: + raise RuntimeError("HTTP session is not initialized; call start() before run_tts()") + voice_config = {"mode": "id", "id": self._settings.voice} output_format = {