From e43351f5f8738fb2b8f7355de749f1e673077683 Mon Sep 17 00:00:00 2001 From: Paul Kompfner Date: Fri, 13 Feb 2026 11:29:37 -0500 Subject: [PATCH] Add class-level `_settings` type annotations to all service classes for better editor support. Standardize all STT, TTS, and LLM service classes to declare `_settings` with the narrowed Settings type as a class-level annotation. This gives editors and type checkers the specific type when hovering or autocompleting on `self._settings` in each service and its subclasses. Inline `self._settings: Type = ...` assignments are replaced with plain `self._settings = ...`. --- src/pipecat/services/anthropic/llm.py | 2 ++ src/pipecat/services/assemblyai/stt.py | 4 +++- src/pipecat/services/asyncai/tts.py | 8 ++++++-- src/pipecat/services/aws/llm.py | 2 ++ src/pipecat/services/aws/stt.py | 4 +++- src/pipecat/services/aws/tts.py | 4 +++- src/pipecat/services/azure/stt.py | 4 +++- src/pipecat/services/azure/tts.py | 4 +++- src/pipecat/services/camb/tts.py | 4 +++- src/pipecat/services/cartesia/stt.py | 4 +++- src/pipecat/services/cartesia/tts.py | 8 ++++++-- src/pipecat/services/deepgram/stt.py | 4 +++- src/pipecat/services/deepgram/stt_sagemaker.py | 4 +++- src/pipecat/services/deepgram/tts.py | 8 ++++++-- src/pipecat/services/elevenlabs/stt.py | 8 ++++++-- src/pipecat/services/elevenlabs/tts.py | 8 ++++++-- src/pipecat/services/fal/stt.py | 4 +++- src/pipecat/services/fish/tts.py | 4 +++- src/pipecat/services/gladia/stt.py | 2 ++ src/pipecat/services/google/gemini_live/llm.py | 2 ++ src/pipecat/services/google/llm.py | 2 ++ src/pipecat/services/google/stt.py | 2 ++ src/pipecat/services/google/tts.py | 12 +++++++++--- src/pipecat/services/gradium/stt.py | 4 +++- src/pipecat/services/gradium/tts.py | 4 +++- src/pipecat/services/grok/realtime/llm.py | 2 ++ src/pipecat/services/groq/tts.py | 4 +++- src/pipecat/services/hathora/stt.py | 4 +++- src/pipecat/services/hathora/tts.py | 4 +++- src/pipecat/services/inworld/tts.py | 8 ++++++-- src/pipecat/services/kokoro/tts.py | 4 +++- src/pipecat/services/llm_service.py | 2 ++ src/pipecat/services/lmnt/tts.py | 4 +++- src/pipecat/services/minimax/tts.py | 4 +++- src/pipecat/services/neuphonic/tts.py | 4 +++- src/pipecat/services/nvidia/stt.py | 8 ++++++-- src/pipecat/services/openai/base_llm.py | 2 ++ src/pipecat/services/openai/realtime/llm.py | 2 ++ src/pipecat/services/openai/stt.py | 4 +++- src/pipecat/services/openai/tts.py | 4 +++- src/pipecat/services/openai_realtime_beta/openai.py | 2 ++ src/pipecat/services/playht/tts.py | 8 ++++++-- src/pipecat/services/resembleai/tts.py | 4 +++- src/pipecat/services/rime/tts.py | 12 +++++++++--- src/pipecat/services/sarvam/stt.py | 4 +++- src/pipecat/services/sarvam/tts.py | 8 ++++++-- src/pipecat/services/soniox/stt.py | 2 ++ src/pipecat/services/speechmatics/stt.py | 2 ++ src/pipecat/services/stt_service.py | 2 ++ src/pipecat/services/tts_service.py | 2 ++ src/pipecat/services/ultravox/llm.py | 2 ++ src/pipecat/services/whisper/base_stt.py | 4 +++- src/pipecat/services/whisper/stt.py | 8 ++++++-- src/pipecat/services/xtts/tts.py | 4 +++- 54 files changed, 188 insertions(+), 52 deletions(-) diff --git a/src/pipecat/services/anthropic/llm.py b/src/pipecat/services/anthropic/llm.py index 36ee104f5..25611d0d1 100644 --- a/src/pipecat/services/anthropic/llm.py +++ b/src/pipecat/services/anthropic/llm.py @@ -129,6 +129,8 @@ class AnthropicLLMService(LLMService): Can use custom clients like AsyncAnthropicBedrock and AsyncAnthropicVertex. """ + _settings: AnthropicLLMSettings + # Overriding the default adapter to use the Anthropic one. adapter_class = AnthropicLLMAdapter diff --git a/src/pipecat/services/assemblyai/stt.py b/src/pipecat/services/assemblyai/stt.py index 278873fdf..910d1e005 100644 --- a/src/pipecat/services/assemblyai/stt.py +++ b/src/pipecat/services/assemblyai/stt.py @@ -75,6 +75,8 @@ class AssemblyAISTTService(WebsocketSTTService): for audio processing and connection management. """ + _settings: AssemblyAISTTSettings + def __init__( self, *, @@ -111,7 +113,7 @@ class AssemblyAISTTService(WebsocketSTTService): ) self._api_key = api_key - self._settings: AssemblyAISTTSettings = AssemblyAISTTSettings( + self._settings = AssemblyAISTTSettings( language=language, connection_params=connection_params, ) diff --git a/src/pipecat/services/asyncai/tts.py b/src/pipecat/services/asyncai/tts.py index aecf69a26..2b0740956 100644 --- a/src/pipecat/services/asyncai/tts.py +++ b/src/pipecat/services/asyncai/tts.py @@ -95,6 +95,8 @@ class AsyncAITTSService(AudioContextTTSService): Provides text-to-speech using Async's streaming WebSocket API. """ + _settings: AsyncAITTSSettings + class InputParams(BaseModel): """Input parameters for Async TTS configuration. @@ -148,7 +150,7 @@ class AsyncAITTSService(AudioContextTTSService): self._api_key = api_key self._api_version = version self._url = url - self._settings: AsyncAITTSSettings = AsyncAITTSSettings( + self._settings = AsyncAITTSSettings( model=model, voice=voice_id, output_format={ @@ -431,6 +433,8 @@ class AsyncAIHttpTTSService(TTSService): connection is not required or desired. """ + _settings: AsyncAITTSSettings + class InputParams(BaseModel): """Input parameters for Async API. @@ -477,7 +481,7 @@ class AsyncAIHttpTTSService(TTSService): self._api_key = api_key self._base_url = url self._api_version = version - self._settings: AsyncAITTSSettings = AsyncAITTSSettings( + self._settings = AsyncAITTSSettings( model=model, voice=voice_id, output_container=container, diff --git a/src/pipecat/services/aws/llm.py b/src/pipecat/services/aws/llm.py index 032cee060..50de0de2c 100644 --- a/src/pipecat/services/aws/llm.py +++ b/src/pipecat/services/aws/llm.py @@ -743,6 +743,8 @@ class AWSBedrockLLMService(LLMService): vision capabilities. """ + _settings: AWSBedrockLLMSettings + # Overriding the default adapter to use the Anthropic one. adapter_class = AWSBedrockLLMAdapter diff --git a/src/pipecat/services/aws/stt.py b/src/pipecat/services/aws/stt.py index cb52da12a..cd8a7103c 100644 --- a/src/pipecat/services/aws/stt.py +++ b/src/pipecat/services/aws/stt.py @@ -72,6 +72,8 @@ class AWSTranscribeSTTService(WebsocketSTTService): final transcription results. """ + _settings: AWSTranscribeSTTSettings + def __init__( self, *, @@ -99,7 +101,7 @@ class AWSTranscribeSTTService(WebsocketSTTService): """ super().__init__(ttfs_p99_latency=ttfs_p99_latency, **kwargs) - self._settings: AWSTranscribeSTTSettings = AWSTranscribeSTTSettings( + self._settings = AWSTranscribeSTTSettings( language=language, sample_rate=sample_rate, media_encoding="linear16", diff --git a/src/pipecat/services/aws/tts.py b/src/pipecat/services/aws/tts.py index 5086b1469..b7f6386ca 100644 --- a/src/pipecat/services/aws/tts.py +++ b/src/pipecat/services/aws/tts.py @@ -150,6 +150,8 @@ class AWSPollyTTSService(TTSService): options including prosody controls. """ + _settings: AWSPollyTTSSettings + class InputParams(BaseModel): """Input parameters for AWS Polly TTS configuration. @@ -206,7 +208,7 @@ class AWSPollyTTSService(TTSService): } self._aws_session = aioboto3.Session() - self._settings: AWSPollyTTSSettings = AWSPollyTTSSettings( + self._settings = AWSPollyTTSSettings( voice=voice_id, engine=params.engine, language=self.language_to_service_language(params.language) diff --git a/src/pipecat/services/azure/stt.py b/src/pipecat/services/azure/stt.py index bf3f70653..95840bde9 100644 --- a/src/pipecat/services/azure/stt.py +++ b/src/pipecat/services/azure/stt.py @@ -71,6 +71,8 @@ class AzureSTTService(STTService): provides real-time transcription results with timing information. """ + _settings: AzureSTTSettings + def __init__( self, *, @@ -107,7 +109,7 @@ class AzureSTTService(STTService): self._audio_stream = None self._speech_recognizer = None - self._settings: AzureSTTSettings = AzureSTTSettings( + self._settings = AzureSTTSettings( region=region, language=language_to_azure_language(language), sample_rate=sample_rate, diff --git a/src/pipecat/services/azure/tts.py b/src/pipecat/services/azure/tts.py index 04b51d10b..ba6d8ac13 100644 --- a/src/pipecat/services/azure/tts.py +++ b/src/pipecat/services/azure/tts.py @@ -100,6 +100,8 @@ class AzureBaseTTSService: This is a mixin class and should be used alongside TTSService or its subclasses. """ + _settings: AzureTTSSettings + # Define SSML escape mappings based on SSML reserved characters # See - https://learn.microsoft.com/en-us/azure/ai-services/speech-service/speech-synthesis-markup-structure SSML_ESCAPE_CHARS = { @@ -153,7 +155,7 @@ class AzureBaseTTSService: """ params = params or AzureBaseTTSService.InputParams() - self._settings: AzureTTSSettings = AzureTTSSettings( + self._settings = AzureTTSSettings( emphasis=params.emphasis, language=self.language_to_service_language(params.language) if params.language diff --git a/src/pipecat/services/camb/tts.py b/src/pipecat/services/camb/tts.py index 8a6f67231..c484a3c80 100644 --- a/src/pipecat/services/camb/tts.py +++ b/src/pipecat/services/camb/tts.py @@ -170,6 +170,8 @@ class CambTTSService(TTSService): ) """ + _settings: CambTTSSettings + class InputParams(BaseModel): """Input parameters for Camb.ai TTS configuration. @@ -226,7 +228,7 @@ class CambTTSService(TTSService): ) # Build settings - self._settings: CambTTSSettings = CambTTSSettings( + self._settings = CambTTSSettings( model=model, voice=voice_id, language=( diff --git a/src/pipecat/services/cartesia/stt.py b/src/pipecat/services/cartesia/stt.py index 624801bfb..7f684f886 100644 --- a/src/pipecat/services/cartesia/stt.py +++ b/src/pipecat/services/cartesia/stt.py @@ -149,6 +149,8 @@ class CartesiaSTTService(WebsocketSTTService): See: https://docs.cartesia.ai/api-reference/stt/stt """ + _settings: CartesiaSTTSettings + def __init__( self, *, @@ -194,7 +196,7 @@ class CartesiaSTTService(WebsocketSTTService): k: v for k, v in merged_options.items() if not isinstance(v, str) or v != "None" } - self._settings: CartesiaSTTSettings = CartesiaSTTSettings( + self._settings = CartesiaSTTSettings( model=merged_options["model"], language=merged_options.get("language"), encoding=merged_options.get("encoding", "pcm_s16le"), diff --git a/src/pipecat/services/cartesia/tts.py b/src/pipecat/services/cartesia/tts.py index 531aafdf7..117853e36 100644 --- a/src/pipecat/services/cartesia/tts.py +++ b/src/pipecat/services/cartesia/tts.py @@ -226,6 +226,8 @@ class CartesiaTTSService(AudioContextWordTTSService): customization options including speed and emotion controls. """ + _settings: CartesiaTTSSettings + class InputParams(BaseModel): """Input parameters for Cartesia TTS configuration. @@ -316,7 +318,7 @@ class CartesiaTTSService(AudioContextWordTTSService): self._api_key = api_key self._cartesia_version = cartesia_version self._url = url - self._settings: CartesiaTTSSettings = CartesiaTTSSettings( + self._settings = CartesiaTTSSettings( output_container=container, output_encoding=encoding, output_sample_rate=0, @@ -655,6 +657,8 @@ class CartesiaHttpTTSService(TTSService): integration is preferred. """ + _settings: CartesiaTTSSettings + class InputParams(BaseModel): """Input parameters for Cartesia HTTP TTS configuration. @@ -712,7 +716,7 @@ class CartesiaHttpTTSService(TTSService): self._api_key = api_key self._base_url = base_url self._cartesia_version = cartesia_version - self._settings: CartesiaTTSSettings = CartesiaTTSSettings( + self._settings = CartesiaTTSSettings( model=model, voice=voice_id, output_container=container, diff --git a/src/pipecat/services/deepgram/stt.py b/src/pipecat/services/deepgram/stt.py index 91d4308cb..2beaec80c 100644 --- a/src/pipecat/services/deepgram/stt.py +++ b/src/pipecat/services/deepgram/stt.py @@ -65,6 +65,8 @@ class DeepgramSTTService(STTService): Supports configurable models, languages, and various audio processing options. """ + _settings: DeepgramSTTSettings + def __init__( self, *, @@ -143,7 +145,7 @@ class DeepgramSTTService(STTService): self.set_model_name(merged_options["model"]) merged_live_options = LiveOptions(**merged_options) - self._settings: DeepgramSTTSettings = DeepgramSTTSettings( + self._settings = DeepgramSTTSettings( model=merged_options.get("model"), language=merged_options.get("language"), live_options=merged_live_options, diff --git a/src/pipecat/services/deepgram/stt_sagemaker.py b/src/pipecat/services/deepgram/stt_sagemaker.py index 95242ade6..68ec9651b 100644 --- a/src/pipecat/services/deepgram/stt_sagemaker.py +++ b/src/pipecat/services/deepgram/stt_sagemaker.py @@ -88,6 +88,8 @@ class DeepgramSageMakerSTTService(STTService): ) """ + _settings: DeepgramSageMakerSTTSettings + def __init__( self, *, @@ -143,7 +145,7 @@ class DeepgramSageMakerSTTService(STTService): self.set_model_name(merged_options["model"]) merged_live_options = LiveOptions(**merged_options) - self._settings: DeepgramSageMakerSTTSettings = DeepgramSageMakerSTTSettings( + self._settings = DeepgramSageMakerSTTSettings( model=merged_options.get("model"), language=merged_options.get("language"), live_options=merged_live_options, diff --git a/src/pipecat/services/deepgram/tts.py b/src/pipecat/services/deepgram/tts.py index 4c698dcea..7ae0fb9ac 100644 --- a/src/pipecat/services/deepgram/tts.py +++ b/src/pipecat/services/deepgram/tts.py @@ -64,6 +64,8 @@ class DeepgramTTSService(WebsocketTTSService): message for conversational AI use cases. """ + _settings: DeepgramTTSSettings + SUPPORTED_ENCODINGS = ("linear16", "mulaw", "alaw") def __init__( @@ -104,7 +106,7 @@ class DeepgramTTSService(WebsocketTTSService): self._api_key = api_key self._base_url = base_url - self._settings: DeepgramTTSSettings = DeepgramTTSSettings( + self._settings = DeepgramTTSSettings( model=voice, voice=voice, encoding=encoding, @@ -345,6 +347,8 @@ class DeepgramHttpTTSService(TTSService): configurable sample rates and quality settings. """ + _settings: DeepgramTTSSettings + def __init__( self, *, @@ -372,7 +376,7 @@ class DeepgramHttpTTSService(TTSService): self._api_key = api_key self._session = aiohttp_session self._base_url = base_url - self._settings: DeepgramTTSSettings = DeepgramTTSSettings( + self._settings = DeepgramTTSSettings( model=voice, voice=voice, encoding=encoding, diff --git a/src/pipecat/services/elevenlabs/stt.py b/src/pipecat/services/elevenlabs/stt.py index 950dc5de9..b33fee710 100644 --- a/src/pipecat/services/elevenlabs/stt.py +++ b/src/pipecat/services/elevenlabs/stt.py @@ -215,6 +215,8 @@ class ElevenLabsSTTService(SegmentedSTTService): The service uploads audio files to ElevenLabs and receives transcription results directly. """ + _settings: ElevenLabsSTTSettings + class InputParams(BaseModel): """Configuration parameters for ElevenLabs STT API. @@ -264,7 +266,7 @@ class ElevenLabsSTTService(SegmentedSTTService): self._session = aiohttp_session self._model_id = model - self._settings: ElevenLabsSTTSettings = ElevenLabsSTTSettings( + self._settings = ElevenLabsSTTSettings( model=model, language=self.language_to_service_language(params.language) if params.language @@ -449,6 +451,8 @@ class ElevenLabsRealtimeSTTService(WebsocketSTTService): commit transcript segments, providing consistency with other STT services. """ + _settings: ElevenLabsRealtimeSTTSettings + class InputParams(BaseModel): """Configuration parameters for ElevenLabs Realtime STT API. @@ -517,7 +521,7 @@ class ElevenLabsRealtimeSTTService(WebsocketSTTService): self._audio_format = "" # initialized in start() self._receive_task = None - self._settings: ElevenLabsRealtimeSTTSettings = ElevenLabsRealtimeSTTSettings( + self._settings = ElevenLabsRealtimeSTTSettings( model=model, language=params.language_code, commit_strategy=params.commit_strategy, diff --git a/src/pipecat/services/elevenlabs/tts.py b/src/pipecat/services/elevenlabs/tts.py index b061383f3..cd3a99e1e 100644 --- a/src/pipecat/services/elevenlabs/tts.py +++ b/src/pipecat/services/elevenlabs/tts.py @@ -321,6 +321,8 @@ class ElevenLabsTTSService(AudioContextWordTTSService): customization options including stability, similarity boost, and speed controls. """ + _settings: ElevenLabsTTSSettings + class InputParams(BaseModel): """Input parameters for ElevenLabs TTS configuration. @@ -401,7 +403,7 @@ class ElevenLabsTTSService(AudioContextWordTTSService): self._api_key = api_key self._url = url - self._settings: ElevenLabsTTSSettings = ElevenLabsTTSSettings( + self._settings = ElevenLabsTTSSettings( model=model, voice=voice_id, language=( @@ -836,6 +838,8 @@ class ElevenLabsHttpTTSService(WordTTSService): connection is not required or desired. """ + _settings: ElevenLabsHttpTTSSettings + class InputParams(BaseModel): """Input parameters for ElevenLabs HTTP TTS configuration. @@ -902,7 +906,7 @@ class ElevenLabsHttpTTSService(WordTTSService): self._params = params self._session = aiohttp_session - self._settings: ElevenLabsHttpTTSSettings = ElevenLabsHttpTTSSettings( + self._settings = ElevenLabsHttpTTSSettings( model=model, voice=voice_id, language=self.language_to_service_language(params.language) diff --git a/src/pipecat/services/fal/stt.py b/src/pipecat/services/fal/stt.py index eef0e0487..a459d15dd 100644 --- a/src/pipecat/services/fal/stt.py +++ b/src/pipecat/services/fal/stt.py @@ -171,6 +171,8 @@ class FalSTTService(SegmentedSTTService): segments. It inherits from SegmentedSTTService to handle audio buffering and speech detection. """ + _settings: FalSTTSettings + class InputParams(BaseModel): """Configuration parameters for Fal's Wizper API. @@ -221,7 +223,7 @@ class FalSTTService(SegmentedSTTService): ) self._fal_client = fal_client.AsyncClient(key=api_key or os.getenv("FAL_KEY")) - self._settings: FalSTTSettings = FalSTTSettings( + self._settings = FalSTTSettings( language=self.language_to_service_language(params.language) if params.language else "en", diff --git a/src/pipecat/services/fish/tts.py b/src/pipecat/services/fish/tts.py index 5517758ad..5c56d0c91 100644 --- a/src/pipecat/services/fish/tts.py +++ b/src/pipecat/services/fish/tts.py @@ -78,6 +78,8 @@ class FishAudioTTSService(InterruptibleTTSService): audio generation with interruption handling. """ + _settings: FishAudioTTSSettings + class InputParams(BaseModel): """Input parameters for Fish Audio TTS configuration. @@ -161,7 +163,7 @@ class FishAudioTTSService(InterruptibleTTSService): self._receive_task = None self._request_id = None - self._settings: FishAudioTTSSettings = FishAudioTTSSettings( + self._settings = FishAudioTTSSettings( voice=reference_id, fish_sample_rate=0, latency=params.latency, diff --git a/src/pipecat/services/gladia/stt.py b/src/pipecat/services/gladia/stt.py index 76a1620e1..d56150a29 100644 --- a/src/pipecat/services/gladia/stt.py +++ b/src/pipecat/services/gladia/stt.py @@ -204,6 +204,8 @@ class GladiaSTTService(WebsocketSTTService): Use :class:`~pipecat.services.gladia.config.GladiaInputParams` directly instead. """ + _settings: GladiaSTTSettings + # Maintain backward compatibility InputParams = _InputParamsDescriptor() diff --git a/src/pipecat/services/google/gemini_live/llm.py b/src/pipecat/services/google/gemini_live/llm.py index 1edab5783..2e8a2efbd 100644 --- a/src/pipecat/services/google/gemini_live/llm.py +++ b/src/pipecat/services/google/gemini_live/llm.py @@ -635,6 +635,8 @@ class GeminiLiveLLMService(LLMService): responses, and tool usage. """ + _settings: GeminiLiveLLMSettings + # Overriding the default adapter to use the Gemini one. adapter_class = GeminiLLMAdapter diff --git a/src/pipecat/services/google/llm.py b/src/pipecat/services/google/llm.py index 692106241..7f6dd724c 100644 --- a/src/pipecat/services/google/llm.py +++ b/src/pipecat/services/google/llm.py @@ -692,6 +692,8 @@ class GoogleLLMService(LLMService): expected by the Google AI model. """ + _settings: GoogleLLMSettings + # Overriding the default adapter to use the Gemini one. adapter_class = GeminiLLMAdapter diff --git a/src/pipecat/services/google/stt.py b/src/pipecat/services/google/stt.py index 8f762da9d..585b766f4 100644 --- a/src/pipecat/services/google/stt.py +++ b/src/pipecat/services/google/stt.py @@ -412,6 +412,8 @@ class GoogleSTTService(STTService): ValueError: If project ID is not found in credentials. """ + _settings: GoogleSTTSettings + # Google Cloud's STT service has a connection time limit of 5 minutes per stream. # They've shared an "endless streaming" example that guided this implementation: # https://cloud.google.com/speech-to-text/docs/transcribe-streaming-audio#endless-streaming diff --git a/src/pipecat/services/google/tts.py b/src/pipecat/services/google/tts.py index d015571d0..46ec96f3e 100644 --- a/src/pipecat/services/google/tts.py +++ b/src/pipecat/services/google/tts.py @@ -547,6 +547,8 @@ class GoogleHttpTTSService(TTSService): Chirp and Journey voices don't support SSML and will use plain text input. """ + _settings: GoogleHttpTTSSettings + class InputParams(BaseModel): """Input parameters for Google HTTP TTS voice customization. @@ -597,7 +599,7 @@ class GoogleHttpTTSService(TTSService): params = params or GoogleHttpTTSService.InputParams() self._location = location - self._settings: GoogleHttpTTSSettings = GoogleHttpTTSSettings( + self._settings = GoogleHttpTTSSettings( pitch=params.pitch, rate=params.rate, speaking_rate=params.speaking_rate, @@ -968,6 +970,8 @@ class GoogleTTSService(GoogleBaseTTSService): ) """ + _settings: GoogleStreamTTSSettings + class InputParams(BaseModel): """Input parameters for Google streaming TTS configuration. @@ -1008,7 +1012,7 @@ class GoogleTTSService(GoogleBaseTTSService): params = params or GoogleTTSService.InputParams() self._location = location - self._settings: GoogleStreamTTSSettings = GoogleStreamTTSSettings( + self._settings = GoogleStreamTTSSettings( language=self.language_to_service_language(params.language) if params.language else "en-US", @@ -1109,6 +1113,8 @@ class GeminiTTSService(GoogleBaseTTSService): ) """ + _settings: GeminiTTSSettings + GOOGLE_SAMPLE_RATE = 24000 # Google TTS always outputs at 24kHz # List of available Gemini TTS voices @@ -1216,7 +1222,7 @@ class GeminiTTSService(GoogleBaseTTSService): self._location = location self._model = model self._voice_id = voice_id - self._settings: GeminiTTSSettings = GeminiTTSSettings( + self._settings = GeminiTTSSettings( language=self.language_to_service_language(params.language) if params.language else "en-US", diff --git a/src/pipecat/services/gradium/stt.py b/src/pipecat/services/gradium/stt.py index 2bad8cf30..ff2002625 100644 --- a/src/pipecat/services/gradium/stt.py +++ b/src/pipecat/services/gradium/stt.py @@ -86,6 +86,8 @@ class GradiumSTTService(WebsocketSTTService): for audio processing and connection management. """ + _settings: GradiumSTTSettings + class InputParams(BaseModel): """Configuration parameters for Gradium STT API. @@ -145,7 +147,7 @@ class GradiumSTTService(WebsocketSTTService): params = params or GradiumSTTService.InputParams() - self._settings: GradiumSTTSettings = GradiumSTTSettings( + self._settings = GradiumSTTSettings( language=params.language, delay_in_frames=params.delay_in_frames if params.delay_in_frames else NOT_GIVEN, ) diff --git a/src/pipecat/services/gradium/tts.py b/src/pipecat/services/gradium/tts.py index e129fba68..5dc355b91 100644 --- a/src/pipecat/services/gradium/tts.py +++ b/src/pipecat/services/gradium/tts.py @@ -53,6 +53,8 @@ class GradiumTTSSettings(TTSSettings): class GradiumTTSService(InterruptibleWordTTSService): """Text-to-Speech service using Gradium's websocket API.""" + _settings: GradiumTTSSettings + class InputParams(BaseModel): """Configuration parameters for Gradium TTS service. @@ -99,7 +101,7 @@ class GradiumTTSService(InterruptibleWordTTSService): self._url = url self._voice_id = voice_id self._json_config = json_config - self._settings: GradiumTTSSettings = GradiumTTSSettings( + self._settings = GradiumTTSSettings( model=model, voice=voice_id, output_format="pcm", diff --git a/src/pipecat/services/grok/realtime/llm.py b/src/pipecat/services/grok/realtime/llm.py index 7cb619a7d..dfe039bbc 100644 --- a/src/pipecat/services/grok/realtime/llm.py +++ b/src/pipecat/services/grok/realtime/llm.py @@ -113,6 +113,8 @@ class GrokRealtimeLLMService(LLMService): - Server-side VAD (Voice Activity Detection) """ + _settings: GrokRealtimeLLMSettings + # Use the Grok-specific adapter adapter_class = GrokRealtimeLLMAdapter diff --git a/src/pipecat/services/groq/tts.py b/src/pipecat/services/groq/tts.py index 678a2426d..8e551725f 100644 --- a/src/pipecat/services/groq/tts.py +++ b/src/pipecat/services/groq/tts.py @@ -57,6 +57,8 @@ class GroqTTSService(TTSService): and output formats. """ + _settings: GroqTTSSettings + class InputParams(BaseModel): """Input parameters for Groq TTS configuration. @@ -109,7 +111,7 @@ class GroqTTSService(TTSService): self._voice_id = voice_id self._params = params - self._settings: GroqTTSSettings = GroqTTSSettings( + self._settings = GroqTTSSettings( model=model_name, voice=voice_id, language=str(params.language) if params.language else "en", diff --git a/src/pipecat/services/hathora/stt.py b/src/pipecat/services/hathora/stt.py index b0e3beead..8af53958d 100644 --- a/src/pipecat/services/hathora/stt.py +++ b/src/pipecat/services/hathora/stt.py @@ -48,6 +48,8 @@ class HathoraSTTService(SegmentedSTTService): [Documentation](https://models.hathora.dev) """ + _settings: HathoraSTTSettings + class InputParams(BaseModel): """Optional input parameters for Hathora STT configuration. @@ -98,7 +100,7 @@ class HathoraSTTService(SegmentedSTTService): params = params or HathoraSTTService.InputParams() - self._settings: HathoraSTTSettings = HathoraSTTSettings( + self._settings = HathoraSTTSettings( model=model, language=params.language, config=params.config, diff --git a/src/pipecat/services/hathora/tts.py b/src/pipecat/services/hathora/tts.py index b821b1e05..2b3a5ddb1 100644 --- a/src/pipecat/services/hathora/tts.py +++ b/src/pipecat/services/hathora/tts.py @@ -68,6 +68,8 @@ class HathoraTTSService(TTSService): [Documentation](https://models.hathora.dev) """ + _settings: HathoraTTSSettings + class InputParams(BaseModel): """Optional input parameters for Hathora TTS configuration. @@ -115,7 +117,7 @@ class HathoraTTSService(TTSService): params = params or HathoraTTSService.InputParams() - self._settings: HathoraTTSSettings = HathoraTTSSettings( + self._settings = HathoraTTSSettings( model=model, voice=voice_id, speed=params.speed, diff --git a/src/pipecat/services/inworld/tts.py b/src/pipecat/services/inworld/tts.py index 68c140187..7f4374b93 100644 --- a/src/pipecat/services/inworld/tts.py +++ b/src/pipecat/services/inworld/tts.py @@ -82,6 +82,8 @@ class InworldHttpTTSService(WordTTSService): Outputs LINEAR16 audio at configurable sample rates with word-level timestamps. """ + _settings: InworldTTSSettings + class InputParams(BaseModel): """Input parameters for Inworld TTS configuration. @@ -138,7 +140,7 @@ class InworldHttpTTSService(WordTTSService): else: self._base_url = "https://api.inworld.ai/tts/v1/voice" - self._settings: InworldTTSSettings = InworldTTSSettings( + self._settings = InworldTTSSettings( model=model, voice=voice_id, audio_encoding=encoding, @@ -438,6 +440,8 @@ class InworldTTSService(AudioContextWordTTSService): with word-level timestamps. """ + _settings: InworldTTSSettings + class InputParams(BaseModel): """Input parameters for Inworld WebSocket TTS configuration. @@ -503,7 +507,7 @@ class InworldTTSService(AudioContextWordTTSService): self._api_key = api_key self._url = url - self._settings: InworldTTSSettings = InworldTTSSettings( + self._settings = InworldTTSSettings( model=model, voice=voice_id, audio_encoding=encoding, diff --git a/src/pipecat/services/kokoro/tts.py b/src/pipecat/services/kokoro/tts.py index 242446de9..6d46441f6 100644 --- a/src/pipecat/services/kokoro/tts.py +++ b/src/pipecat/services/kokoro/tts.py @@ -107,6 +107,8 @@ class KokoroTTSService(TTSService): Automatically downloads model files on first use. """ + _settings: KokoroTTSSettings + class InputParams(BaseModel): """Input parameters for Kokoro TTS configuration. @@ -142,7 +144,7 @@ class KokoroTTSService(TTSService): self._voice_id = voice_id self._lang_code = language_to_kokoro_language(params.language) - self._settings: KokoroTTSSettings = KokoroTTSSettings( + self._settings = KokoroTTSSettings( voice=voice_id, language=language_to_kokoro_language(params.language), lang_code=language_to_kokoro_language(params.language), diff --git a/src/pipecat/services/llm_service.py b/src/pipecat/services/llm_service.py index 3a6e64def..693448cd5 100644 --- a/src/pipecat/services/llm_service.py +++ b/src/pipecat/services/llm_service.py @@ -174,6 +174,8 @@ class LLMService(UserTurnCompletionLLMServiceMixin, AIService): logger.info(f"Starting {len(function_calls)} function calls") """ + _settings: LLMSettings + # OpenAILLMAdapter is used as the default adapter since it aligns with most LLM implementations. # However, subclasses should override this with a more specific adapter when necessary. adapter_class: Type[BaseLLMAdapter] = OpenAILLMAdapter diff --git a/src/pipecat/services/lmnt/tts.py b/src/pipecat/services/lmnt/tts.py index 97569fa1d..9fa727c5f 100644 --- a/src/pipecat/services/lmnt/tts.py +++ b/src/pipecat/services/lmnt/tts.py @@ -92,6 +92,8 @@ class LmntTTSService(InterruptibleTTSService): language settings. """ + _settings: LmntTTSSettings + def __init__( self, *, @@ -122,7 +124,7 @@ class LmntTTSService(InterruptibleTTSService): self._api_key = api_key self._voice_id = voice_id self.set_model_name(model) - self._settings: LmntTTSSettings = LmntTTSSettings( + self._settings = LmntTTSSettings( model=model, voice=voice_id, language=self.language_to_service_language(language), diff --git a/src/pipecat/services/minimax/tts.py b/src/pipecat/services/minimax/tts.py index 6ce3e4b45..db236d6e4 100644 --- a/src/pipecat/services/minimax/tts.py +++ b/src/pipecat/services/minimax/tts.py @@ -132,6 +132,8 @@ class MiniMaxHttpTTSService(TTSService): https://www.minimax.io/platform/document/T2A%20V2?key=66719005a427f0c8a5701643 """ + _settings: MiniMaxTTSSettings + class InputParams(BaseModel): """Configuration parameters for MiniMax TTS. @@ -208,7 +210,7 @@ class MiniMaxHttpTTSService(TTSService): self._voice_id = voice_id # Create voice settings - self._settings: MiniMaxTTSSettings = MiniMaxTTSSettings( + self._settings = MiniMaxTTSSettings( model=model, voice=voice_id, stream=True, diff --git a/src/pipecat/services/neuphonic/tts.py b/src/pipecat/services/neuphonic/tts.py index b7019e6d6..de92c48a2 100644 --- a/src/pipecat/services/neuphonic/tts.py +++ b/src/pipecat/services/neuphonic/tts.py @@ -99,6 +99,8 @@ class NeuphonicTTSService(InterruptibleTTSService): parameters for high-quality speech generation. """ + _settings: NeuphonicTTSSettings + class InputParams(BaseModel): """Input parameters for Neuphonic TTS configuration. @@ -146,7 +148,7 @@ class NeuphonicTTSService(InterruptibleTTSService): self._api_key = api_key self._url = url - self._settings: NeuphonicTTSSettings = NeuphonicTTSSettings( + self._settings = NeuphonicTTSSettings( lang_code=self.language_to_service_language(params.language), speed=params.speed, encoding=encoding, diff --git a/src/pipecat/services/nvidia/stt.py b/src/pipecat/services/nvidia/stt.py index c65d6da62..3a36e062e 100644 --- a/src/pipecat/services/nvidia/stt.py +++ b/src/pipecat/services/nvidia/stt.py @@ -125,6 +125,8 @@ class NvidiaSTTService(STTService): processing for low-latency applications. """ + _settings: NvidiaSTTSettings + class InputParams(BaseModel): """Configuration parameters for NVIDIA Riva STT service. @@ -178,7 +180,7 @@ class NvidiaSTTService(STTService): self._custom_configuration = "" self._function_id = model_function_map.get("function_id") - self._settings: NvidiaSTTSettings = NvidiaSTTSettings( + self._settings = NvidiaSTTSettings( language=params.language, ) @@ -399,6 +401,8 @@ class NvidiaSegmentedSTTService(SegmentedSTTService): audio buffering and speech detection. """ + _settings: NvidiaSegmentedSTTSettings + class InputParams(BaseModel): """Configuration parameters for NVIDIA Riva segmented STT service. @@ -470,7 +474,7 @@ class NvidiaSegmentedSTTService(SegmentedSTTService): self._config = None self._asr_service = None - self._settings: NvidiaSegmentedSTTSettings = NvidiaSegmentedSTTSettings( + self._settings = NvidiaSegmentedSTTSettings( language=params.language or Language.EN_US, profanity_filter=params.profanity_filter, automatic_punctuation=params.automatic_punctuation, diff --git a/src/pipecat/services/openai/base_llm.py b/src/pipecat/services/openai/base_llm.py index 2ac53794c..454087508 100644 --- a/src/pipecat/services/openai/base_llm.py +++ b/src/pipecat/services/openai/base_llm.py @@ -70,6 +70,8 @@ class BaseOpenAILLMService(LLMService): configurations. """ + _settings: OpenAILLMSettings + class InputParams(BaseModel): """Input parameters for OpenAI model configuration. diff --git a/src/pipecat/services/openai/realtime/llm.py b/src/pipecat/services/openai/realtime/llm.py index abd66963b..825639950 100644 --- a/src/pipecat/services/openai/realtime/llm.py +++ b/src/pipecat/services/openai/realtime/llm.py @@ -110,6 +110,8 @@ class OpenAIRealtimeLLMService(LLMService): management, and real-time transcription. """ + _settings: OpenAIRealtimeLLMSettings + # Overriding the default adapter to use the OpenAIRealtimeLLMAdapter one. adapter_class = OpenAIRealtimeLLMAdapter diff --git a/src/pipecat/services/openai/stt.py b/src/pipecat/services/openai/stt.py index 12eada24e..266b2964b 100644 --- a/src/pipecat/services/openai/stt.py +++ b/src/pipecat/services/openai/stt.py @@ -169,6 +169,8 @@ class OpenAIRealtimeSTTService(WebsocketSTTService): ) """ + _settings: OpenAIRealtimeSTTSettings + def __init__( self, *, @@ -231,7 +233,7 @@ class OpenAIRealtimeSTTService(WebsocketSTTService): self._noise_reduction = noise_reduction self._should_interrupt = should_interrupt - self._settings: OpenAIRealtimeSTTSettings = OpenAIRealtimeSTTSettings( + self._settings = OpenAIRealtimeSTTSettings( model=model, language=language, prompt=prompt, diff --git a/src/pipecat/services/openai/tts.py b/src/pipecat/services/openai/tts.py index ee1e34316..3572d287e 100644 --- a/src/pipecat/services/openai/tts.py +++ b/src/pipecat/services/openai/tts.py @@ -83,6 +83,8 @@ class OpenAITTSService(TTSService): speech synthesis with streaming audio output. """ + _settings: OpenAITTSSettings + OPENAI_SAMPLE_RATE = 24000 # OpenAI TTS always outputs at 24kHz class InputParams(BaseModel): @@ -147,7 +149,7 @@ class OpenAITTSService(TTSService): stacklevel=2, ) - self._settings: OpenAITTSSettings = OpenAITTSSettings( + self._settings = OpenAITTSSettings( model=model, voice=voice, instructions=params.instructions if params else instructions, diff --git a/src/pipecat/services/openai_realtime_beta/openai.py b/src/pipecat/services/openai_realtime_beta/openai.py index d37b1434e..b7703ad98 100644 --- a/src/pipecat/services/openai_realtime_beta/openai.py +++ b/src/pipecat/services/openai_realtime_beta/openai.py @@ -115,6 +115,8 @@ class OpenAIRealtimeBetaLLMService(LLMService): management, and real-time transcription. """ + _settings: OpenAIRealtimeBetaLLMSettings + # Overriding the default adapter to use the OpenAIRealtimeLLMAdapter one. adapter_class = OpenAIRealtimeLLMAdapter diff --git a/src/pipecat/services/playht/tts.py b/src/pipecat/services/playht/tts.py index f79f54560..7d61ffd87 100644 --- a/src/pipecat/services/playht/tts.py +++ b/src/pipecat/services/playht/tts.py @@ -131,6 +131,8 @@ class PlayHTTTSService(InterruptibleTTSService): language settings. """ + _settings: PlayHTTTSSettings + class InputParams(BaseModel): """Input parameters for PlayHT TTS configuration. @@ -191,7 +193,7 @@ class PlayHTTTSService(InterruptibleTTSService): self._receive_task = None self._context_id = None - self._settings: PlayHTTTSSettings = PlayHTTTSSettings( + self._settings = PlayHTTTSSettings( model=voice_engine, voice=voice_url, language=self.language_to_service_language(params.language) @@ -444,6 +446,8 @@ class PlayHTHttpTTSService(TTSService): required and simpler integration is preferred. """ + _settings: PlayHTTTSSettings + class InputParams(BaseModel): """Input parameters for PlayHT HTTP TTS configuration. @@ -522,7 +526,7 @@ class PlayHTHttpTTSService(TTSService): # Extract the base engine name voice_engine = voice_engine.replace("-ws", "") - self._settings: PlayHTTTSSettings = PlayHTTTSSettings( + self._settings = PlayHTTTSSettings( voice=voice_url, language=self.language_to_service_language(params.language) if params.language diff --git a/src/pipecat/services/resembleai/tts.py b/src/pipecat/services/resembleai/tts.py index 08f9b81bd..cd3da1767 100644 --- a/src/pipecat/services/resembleai/tts.py +++ b/src/pipecat/services/resembleai/tts.py @@ -63,6 +63,8 @@ class ResembleAITTSService(AudioContextWordTTSService): multiple simultaneous synthesis requests with proper interruption support. """ + _settings: ResembleAITTSSettings + def __init__( self, *, @@ -93,7 +95,7 @@ class ResembleAITTSService(AudioContextWordTTSService): self._api_key = api_key self._voice_id = voice_id self._url = url - self._settings: ResembleAITTSSettings = ResembleAITTSSettings( + self._settings = ResembleAITTSSettings( voice=voice_id, precision=precision, output_format=output_format, diff --git a/src/pipecat/services/rime/tts.py b/src/pipecat/services/rime/tts.py index 5a3ed67a2..4af9fe63b 100644 --- a/src/pipecat/services/rime/tts.py +++ b/src/pipecat/services/rime/tts.py @@ -134,6 +134,8 @@ class RimeTTSService(AudioContextWordTTSService): within a turn. """ + _settings: RimeTTSSettings + class InputParams(BaseModel): """Configuration parameters for Rime TTS service. @@ -207,7 +209,7 @@ class RimeTTSService(AudioContextWordTTSService): self._url = url self._voice_id = voice_id self._model = model - self._settings: RimeTTSSettings = RimeTTSSettings( + self._settings = RimeTTSSettings( speaker=voice_id, modelId=model, audioFormat="pcm", @@ -537,6 +539,8 @@ class RimeHttpTTSService(TTSService): Suitable for use cases where streaming is not required. """ + _settings: RimeTTSSettings + class InputParams(BaseModel): """Configuration parameters for Rime HTTP TTS service. @@ -585,7 +589,7 @@ class RimeHttpTTSService(TTSService): self._api_key = api_key self._session = aiohttp_session self._base_url = "https://users.rime.ai/v1/rime-tts" - self._settings: RimeTTSSettings = RimeTTSSettings( + self._settings = RimeTTSSettings( lang=self.language_to_service_language(params.language) if params.language else "eng", speedAlpha=params.speed_alpha, reduceLatency=params.reduce_latency, @@ -706,6 +710,8 @@ class RimeNonJsonTTSService(InterruptibleTTSService): future. This service focuses on the current plain text protocol. """ + _settings: RimeNonJsonTTSSettings + class InputParams(BaseModel): """Configuration parameters for Rime Non-JSON WebSocket TTS service. @@ -763,7 +769,7 @@ class RimeNonJsonTTSService(InterruptibleTTSService): self._url = url self._voice_id = voice_id self._model = model - self._settings: RimeNonJsonTTSSettings = RimeNonJsonTTSSettings( + self._settings = RimeNonJsonTTSSettings( speaker=voice_id, modelId=model, audioFormat=audio_format, diff --git a/src/pipecat/services/sarvam/stt.py b/src/pipecat/services/sarvam/stt.py index e2bc6a08f..834171b32 100644 --- a/src/pipecat/services/sarvam/stt.py +++ b/src/pipecat/services/sarvam/stt.py @@ -154,6 +154,8 @@ class SarvamSTTService(STTService): Provides real-time speech recognition using Sarvam's WebSocket API. """ + _settings: SarvamSTTSettings + class InputParams(BaseModel): """Configuration parameters for Sarvam STT service. @@ -247,7 +249,7 @@ class SarvamSTTService(STTService): # Resolve mode default from model config mode = params.mode if params.mode is not None else self._config.default_mode - self._settings: SarvamSTTSettings = SarvamSTTSettings( + self._settings = SarvamSTTSettings( model=model, language=params.language, prompt=params.prompt if params.prompt is not None else NOT_GIVEN, diff --git a/src/pipecat/services/sarvam/tts.py b/src/pipecat/services/sarvam/tts.py index e28914b4c..ec51a85d5 100644 --- a/src/pipecat/services/sarvam/tts.py +++ b/src/pipecat/services/sarvam/tts.py @@ -371,6 +371,8 @@ class SarvamHttpTTSService(TTSService): ) """ + _settings: SarvamHttpTTSSettings + class InputParams(BaseModel): """Input parameters for Sarvam TTS configuration. @@ -478,7 +480,7 @@ class SarvamHttpTTSService(TTSService): pace = max(pace_min, min(pace_max, pace)) # Build base settings - self._settings: SarvamHttpTTSSettings = SarvamHttpTTSSettings( + self._settings = SarvamHttpTTSSettings( language=( self.language_to_service_language(params.language) if params.language else "en-IN" ), @@ -684,6 +686,8 @@ class SarvamTTSService(InterruptibleTTSService): See https://docs.sarvam.ai/api-reference-docs/text-to-speech/stream for API details. """ + _settings: SarvamWSTTSSettings + class InputParams(BaseModel): """Configuration parameters for Sarvam TTS WebSocket service. @@ -837,7 +841,7 @@ class SarvamTTSService(InterruptibleTTSService): pace = max(pace_min, min(pace_max, pace)) # Build base settings - self._settings: SarvamWSTTSSettings = SarvamWSTTSSettings( + self._settings = SarvamWSTTSSettings( target_language_code=( self.language_to_service_language(params.language) if params.language else "en-IN" ), diff --git a/src/pipecat/services/soniox/stt.py b/src/pipecat/services/soniox/stt.py index 9d732a356..c3d9638c1 100644 --- a/src/pipecat/services/soniox/stt.py +++ b/src/pipecat/services/soniox/stt.py @@ -157,6 +157,8 @@ class SonioxSTTService(WebsocketSTTService): For complete API documentation, see: https://soniox.com/docs/speech-to-text/api-reference/websocket-api """ + _settings: SonioxSTTSettings + def __init__( self, *, diff --git a/src/pipecat/services/speechmatics/stt.py b/src/pipecat/services/speechmatics/stt.py index d04bb564d..462c2fc6f 100644 --- a/src/pipecat/services/speechmatics/stt.py +++ b/src/pipecat/services/speechmatics/stt.py @@ -166,6 +166,8 @@ class SpeechmaticsSTTService(STTService): and speaker diarization. """ + _settings: SpeechmaticsSTTSettings + # Export related classes as class attributes TurnDetectionMode = TurnDetectionMode AudioEncoding = AudioEncoding diff --git a/src/pipecat/services/stt_service.py b/src/pipecat/services/stt_service.py index d4e5f4cb5..22cd4f03d 100644 --- a/src/pipecat/services/stt_service.py +++ b/src/pipecat/services/stt_service.py @@ -70,6 +70,8 @@ class STTService(AIService): logger.error(f"STT connection error: {error}") """ + _settings: STTSettings + def __init__( self, *, diff --git a/src/pipecat/services/tts_service.py b/src/pipecat/services/tts_service.py index 4196e7872..49bb29970 100644 --- a/src/pipecat/services/tts_service.py +++ b/src/pipecat/services/tts_service.py @@ -104,6 +104,8 @@ class TTSService(AIService): logger.debug(f"TTS request: {context_id} - {text}") """ + _settings: TTSSettings + def __init__( self, *, diff --git a/src/pipecat/services/ultravox/llm.py b/src/pipecat/services/ultravox/llm.py index 9f0658486..6f5e5d2ee 100644 --- a/src/pipecat/services/ultravox/llm.py +++ b/src/pipecat/services/ultravox/llm.py @@ -158,6 +158,8 @@ class UltravoxRealtimeLLMService(LLMService): by the model and may not always align with its understanding of user input. """ + _settings: UltravoxRealtimeLLMSettings + def __init__( self, *, diff --git a/src/pipecat/services/whisper/base_stt.py b/src/pipecat/services/whisper/base_stt.py index 2a02c6ce7..6c35824a4 100644 --- a/src/pipecat/services/whisper/base_stt.py +++ b/src/pipecat/services/whisper/base_stt.py @@ -124,6 +124,8 @@ class BaseWhisperSTTService(SegmentedSTTService): including metrics generation and error handling. """ + _settings: BaseWhisperSTTSettings + def __init__( self, *, @@ -161,7 +163,7 @@ class BaseWhisperSTTService(SegmentedSTTService): self._temperature = temperature self._include_prob_metrics = include_prob_metrics - self._settings: BaseWhisperSTTSettings = BaseWhisperSTTSettings( + self._settings = BaseWhisperSTTSettings( model=model, language=self._language, base_url=base_url, diff --git a/src/pipecat/services/whisper/stt.py b/src/pipecat/services/whisper/stt.py index 30451e6d0..d5f4c3f1b 100644 --- a/src/pipecat/services/whisper/stt.py +++ b/src/pipecat/services/whisper/stt.py @@ -211,6 +211,8 @@ class WhisperSTTService(SegmentedSTTService): segments. It supports multiple languages and various model sizes. """ + _settings: WhisperSTTSettings + def __init__( self, *, @@ -238,7 +240,7 @@ class WhisperSTTService(SegmentedSTTService): self._no_speech_prob = no_speech_prob self._model: Optional[WhisperModel] = None - self._settings: WhisperSTTSettings = WhisperSTTSettings( + self._settings = WhisperSTTSettings( model=model if isinstance(model, str) else model.value, language=language, device=self._device, @@ -346,6 +348,8 @@ class WhisperSTTServiceMLX(WhisperSTTService): segments. It's optimized for Apple Silicon and supports multiple languages and quantizations. """ + _settings: WhisperMLXSTTSettings + def __init__( self, *, @@ -371,7 +375,7 @@ class WhisperSTTServiceMLX(WhisperSTTService): self._no_speech_prob = no_speech_prob self._temperature = temperature - self._settings: WhisperMLXSTTSettings = WhisperMLXSTTSettings( + self._settings = WhisperMLXSTTSettings( model=model if isinstance(model, str) else model.value, language=language, no_speech_prob=self._no_speech_prob, diff --git a/src/pipecat/services/xtts/tts.py b/src/pipecat/services/xtts/tts.py index 664d3d4be..4415f9f53 100644 --- a/src/pipecat/services/xtts/tts.py +++ b/src/pipecat/services/xtts/tts.py @@ -89,6 +89,8 @@ class XTTSService(TTSService): studio speakers configuration. """ + _settings: XTTSTTSSettings + def __init__( self, *, @@ -111,7 +113,7 @@ class XTTSService(TTSService): """ super().__init__(sample_rate=sample_rate, **kwargs) - self._settings: XTTSTTSSettings = XTTSTTSSettings( + self._settings = XTTSTTSSettings( voice=voice_id, language=self.language_to_service_language(language), base_url=base_url,