Review feedback, clarify corresponding class in STTSettings docstrings
This commit is contained in:
@@ -81,7 +81,7 @@ def map_language_from_assemblyai(language_code: str) -> Language:
|
||||
|
||||
@dataclass
|
||||
class AssemblyAISTTSettings(STTSettings):
|
||||
"""Settings for the AssemblyAI STT service.
|
||||
"""Settings for AssemblyAISTTService.
|
||||
|
||||
Parameters:
|
||||
formatted_finals: Whether to enable transcript formatting.
|
||||
|
||||
@@ -47,7 +47,7 @@ except ModuleNotFoundError as e:
|
||||
|
||||
@dataclass
|
||||
class AWSTranscribeSTTSettings(STTSettings):
|
||||
"""Settings for the AWS Transcribe STT service."""
|
||||
"""Settings for AWSTranscribeSTTService."""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ except ModuleNotFoundError as e:
|
||||
|
||||
@dataclass
|
||||
class AzureSTTSettings(STTSettings):
|
||||
"""Settings for the Azure STT service."""
|
||||
"""Settings for AzureSTTService."""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ except ModuleNotFoundError as e:
|
||||
|
||||
@dataclass
|
||||
class CartesiaSTTSettings(STTSettings):
|
||||
"""Settings for the Cartesia STT service."""
|
||||
"""Settings for CartesiaSTTService."""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ class FluxEventType(str, Enum):
|
||||
|
||||
@dataclass
|
||||
class DeepgramFluxSTTSettings(STTSettings):
|
||||
"""Settings for the Deepgram Flux STT service.
|
||||
"""Settings for DeepgramFluxSTTService.
|
||||
|
||||
Parameters:
|
||||
eager_eot_threshold: EagerEndOfTurn/TurnResumed threshold. Off by default.
|
||||
|
||||
@@ -177,7 +177,7 @@ class LiveOptions:
|
||||
|
||||
@dataclass
|
||||
class DeepgramSTTSettings(STTSettings):
|
||||
"""Settings for Deepgram STT services.
|
||||
"""Settings for DeepgramSTTService.
|
||||
|
||||
``model`` and ``language`` are inherited from ``STTSettings`` /
|
||||
``ServiceSettings``. Additional Deepgram connection params may
|
||||
|
||||
@@ -179,7 +179,7 @@ class CommitStrategy(str, Enum):
|
||||
|
||||
@dataclass
|
||||
class ElevenLabsSTTSettings(STTSettings):
|
||||
"""Settings for the ElevenLabs file-based STT service.
|
||||
"""Settings for ElevenLabsSTTService.
|
||||
|
||||
Parameters:
|
||||
tag_audio_events: Whether to include audio events like (laughter),
|
||||
@@ -191,7 +191,7 @@ class ElevenLabsSTTSettings(STTSettings):
|
||||
|
||||
@dataclass
|
||||
class ElevenLabsRealtimeSTTSettings(STTSettings):
|
||||
"""Settings for the ElevenLabs Realtime STT service.
|
||||
"""Settings for ElevenLabsRealtimeSTTService.
|
||||
|
||||
See ``ElevenLabsRealtimeSTTService.InputParams`` for detailed descriptions.
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ def language_to_fal_language(language: Language) -> Optional[str]:
|
||||
|
||||
@dataclass
|
||||
class FalSTTSettings(STTSettings):
|
||||
"""Settings for the Fal Wizper STT service."""
|
||||
"""Settings for FalSTTService."""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ class _InputParamsDescriptor:
|
||||
|
||||
@dataclass
|
||||
class GladiaSTTSettings(STTSettings):
|
||||
"""Settings for Gladia STT service.
|
||||
"""Settings for GladiaSTTService.
|
||||
|
||||
Parameters:
|
||||
language_config: Language detection and handling configuration.
|
||||
|
||||
@@ -360,7 +360,7 @@ def language_to_google_stt_language(language: Language) -> Optional[str]:
|
||||
|
||||
@dataclass
|
||||
class GoogleSTTSettings(STTSettings):
|
||||
"""Settings for Google Cloud Speech-to-Text V2.
|
||||
"""Settings for GoogleSTTService.
|
||||
|
||||
Parameters:
|
||||
languages: List of ``Language`` enums for recognition
|
||||
|
||||
@@ -482,7 +482,7 @@ def language_to_gemini_tts_language(language: Language) -> Optional[str]:
|
||||
|
||||
@dataclass
|
||||
class GoogleHttpTTSSettings(TTSSettings):
|
||||
"""Settings for Google HTTP TTS service.
|
||||
"""Settings for GoogleHttpTTSService.
|
||||
|
||||
Parameters:
|
||||
pitch: Voice pitch adjustment (e.g., "+2st", "-50%").
|
||||
@@ -513,7 +513,7 @@ class GoogleHttpTTSSettings(TTSSettings):
|
||||
|
||||
@dataclass
|
||||
class GoogleTTSSettings(TTSSettings):
|
||||
"""Settings for Google streaming TTS service.
|
||||
"""Settings for GoogleTTSService.
|
||||
|
||||
Parameters:
|
||||
speaking_rate: The speaking rate, in the range [0.25, 2.0].
|
||||
@@ -522,9 +522,14 @@ class GoogleTTSSettings(TTSSettings):
|
||||
speaking_rate: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
#: .. deprecated:: 0.0.105
|
||||
#: Use ``GoogleTTSSettings`` instead.
|
||||
GoogleStreamTTSSettings = GoogleTTSSettings
|
||||
|
||||
|
||||
@dataclass
|
||||
class GeminiTTSSettings(TTSSettings):
|
||||
"""Settings for Gemini TTS service.
|
||||
"""Settings for GeminiTTSService.
|
||||
|
||||
Parameters:
|
||||
prompt: Optional style instructions for how to synthesize the content.
|
||||
|
||||
@@ -68,7 +68,7 @@ def language_to_gradium_language(language: Language) -> Optional[str]:
|
||||
|
||||
@dataclass
|
||||
class GradiumSTTSettings(STTSettings):
|
||||
"""Settings for the Gradium STT service."""
|
||||
"""Settings for GradiumSTTService."""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
@@ -93,14 +93,14 @@ def language_to_nvidia_riva_language(language: Language) -> Optional[str]:
|
||||
|
||||
@dataclass
|
||||
class NvidiaSTTSettings(STTSettings):
|
||||
"""Settings for the NVIDIA Riva streaming STT service."""
|
||||
"""Settings for NvidiaSTTService."""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
@dataclass
|
||||
class NvidiaSegmentedSTTSettings(STTSettings):
|
||||
"""Settings for the NVIDIA Riva segmented STT service.
|
||||
"""Settings for NvidiaSegmentedSTTService.
|
||||
|
||||
Parameters:
|
||||
profanity_filter: Whether to filter profanity from results.
|
||||
|
||||
@@ -182,7 +182,7 @@ _OPENAI_SAMPLE_RATE = 24000
|
||||
|
||||
@dataclass
|
||||
class OpenAIRealtimeSTTSettings(STTSettings):
|
||||
"""Settings for the OpenAI Realtime STT service.
|
||||
"""Settings for OpenAIRealtimeSTTService.
|
||||
|
||||
Parameters:
|
||||
prompt: Optional prompt text to guide transcription style.
|
||||
|
||||
@@ -139,7 +139,7 @@ MODEL_CONFIGS: Dict[str, ModelConfig] = {
|
||||
|
||||
@dataclass
|
||||
class SarvamSTTSettings(STTSettings):
|
||||
"""Settings for the Sarvam STT service.
|
||||
"""Settings for SarvamSTTService.
|
||||
|
||||
Parameters:
|
||||
prompt: Optional prompt to guide transcription/translation style/context.
|
||||
|
||||
@@ -141,7 +141,7 @@ def _prepare_language_hints(
|
||||
|
||||
@dataclass
|
||||
class SonioxSTTSettings(STTSettings):
|
||||
"""Settings for Soniox STT service.
|
||||
"""Settings for SonioxSTTService.
|
||||
|
||||
Parameters:
|
||||
language_hints: List of language hints to use for transcription.
|
||||
|
||||
@@ -85,7 +85,7 @@ class TurnDetectionMode(str, Enum):
|
||||
|
||||
@dataclass
|
||||
class SpeechmaticsSTTSettings(STTSettings):
|
||||
"""Settings for Speechmatics STT service.
|
||||
"""Settings for SpeechmaticsSTTService.
|
||||
|
||||
See ``SpeechmaticsSTTService.InputParams`` for detailed descriptions of each field.
|
||||
|
||||
@@ -493,6 +493,12 @@ class SpeechmaticsSTTService(STTService):
|
||||
if settings is not None:
|
||||
default_settings.apply_update(settings)
|
||||
|
||||
# Build SDK config from settings, set model name before calling super
|
||||
self._client: VoiceAgentClient | None = None
|
||||
self._audio_encoding = encoding
|
||||
self._config: VoiceAgentConfig = self._build_config(default_settings)
|
||||
default_settings.model = self._config.operating_point.value
|
||||
|
||||
super().__init__(
|
||||
sample_rate=sample_rate,
|
||||
ttfs_p99_latency=ttfs_p99_latency,
|
||||
@@ -500,13 +506,6 @@ class SpeechmaticsSTTService(STTService):
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
# Build SDK config from settings, then resolve model from operating_point
|
||||
self._client: VoiceAgentClient | None = None
|
||||
self._audio_encoding = encoding
|
||||
self._config: VoiceAgentConfig = self._build_config(self._settings)
|
||||
self._settings.model = self._config.operating_point.value
|
||||
self._sync_model_name_to_metrics()
|
||||
|
||||
# Outbound frame queue
|
||||
self._outbound_frames: asyncio.Queue[Frame] = asyncio.Queue()
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ from pipecat.utils.tracing.service_decorators import traced_stt
|
||||
|
||||
@dataclass
|
||||
class BaseWhisperSTTSettings(STTSettings):
|
||||
"""Settings for Whisper API-based STT services.
|
||||
"""Settings for BaseWhisperSTTService.
|
||||
|
||||
Parameters:
|
||||
prompt: Optional text to guide the model's style or continue
|
||||
|
||||
@@ -176,7 +176,7 @@ def language_to_whisper_language(language: Language) -> Optional[str]:
|
||||
|
||||
@dataclass
|
||||
class WhisperSTTSettings(STTSettings):
|
||||
"""Settings for the local Whisper (Faster Whisper) STT service.
|
||||
"""Settings for WhisperSTTService.
|
||||
|
||||
Parameters:
|
||||
no_speech_prob: Probability threshold for filtering non-speech segments.
|
||||
@@ -187,7 +187,7 @@ class WhisperSTTSettings(STTSettings):
|
||||
|
||||
@dataclass
|
||||
class WhisperMLXSTTSettings(STTSettings):
|
||||
"""Settings for the MLX Whisper STT service.
|
||||
"""Settings for WhisperMLXSTTService.
|
||||
|
||||
Parameters:
|
||||
no_speech_prob: Probability threshold for filtering non-speech segments.
|
||||
|
||||
Reference in New Issue
Block a user