Replace Any with specific types and add | _NotGiven to all *Settings field annotations across 49 service files
Every `*Settings` dataclass field whose default is `NOT_GIVEN` now carries `_NotGiven` in its type union so the type system accurately reflects the three-state semantics (real value, `None` where applicable, or not-yet-specified). Fields previously typed as bare `Any`, `str`, `float`, `bool`, `list`, `dict`, or `Optional[X]` are now narrowed to the specific type from the corresponding `InputParams` Pydantic model.
This commit is contained in:
@@ -59,7 +59,7 @@ from pipecat.processors.aggregators.openai_llm_context import (
|
||||
from pipecat.processors.frame_processor import FrameDirection
|
||||
from pipecat.services.llm_service import FunctionCallFromLLM, LLMService
|
||||
from pipecat.services.settings import NOT_GIVEN as _NOT_GIVEN
|
||||
from pipecat.services.settings import LLMSettings, is_given
|
||||
from pipecat.services.settings import LLMSettings, _NotGiven, is_given
|
||||
from pipecat.utils.tracing.service_decorators import traced_llm
|
||||
|
||||
try:
|
||||
@@ -79,8 +79,10 @@ class AnthropicLLMSettings(LLMSettings):
|
||||
thinking: Extended thinking configuration.
|
||||
"""
|
||||
|
||||
enable_prompt_caching: Any = field(default_factory=lambda: _NOT_GIVEN)
|
||||
thinking: Any = field(default_factory=lambda: _NOT_GIVEN)
|
||||
enable_prompt_caching: bool | _NotGiven = field(default_factory=lambda: _NOT_GIVEN)
|
||||
thinking: "AnthropicLLMService.ThinkingConfig" | _NotGiven = field(
|
||||
default_factory=lambda: _NOT_GIVEN
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def from_mapping(cls, settings):
|
||||
|
||||
@@ -30,7 +30,7 @@ from pipecat.frames.frames import (
|
||||
VADUserStoppedSpeakingFrame,
|
||||
)
|
||||
from pipecat.processors.frame_processor import FrameDirection
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings, _NotGiven
|
||||
from pipecat.services.stt_latency import ASSEMBLYAI_TTFS_P99
|
||||
from pipecat.services.stt_service import WebsocketSTTService
|
||||
from pipecat.transcriptions.language import Language
|
||||
@@ -64,7 +64,9 @@ class AssemblyAISTTSettings(STTSettings):
|
||||
connection_params: Connection configuration parameters.
|
||||
"""
|
||||
|
||||
connection_params: AssemblyAIConnectionParams = field(default_factory=lambda: NOT_GIVEN)
|
||||
connection_params: AssemblyAIConnectionParams | _NotGiven = field(
|
||||
default_factory=lambda: NOT_GIVEN
|
||||
)
|
||||
|
||||
|
||||
class AssemblyAISTTService(WebsocketSTTService):
|
||||
|
||||
@@ -28,7 +28,7 @@ from pipecat.frames.frames import (
|
||||
TTSStoppedFrame,
|
||||
)
|
||||
from pipecat.processors.frame_processor import FrameDirection
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings, _NotGiven
|
||||
from pipecat.services.tts_service import AudioContextTTSService, TTSService
|
||||
from pipecat.transcriptions.language import Language, resolve_language
|
||||
from pipecat.utils.tracing.service_decorators import traced_tts
|
||||
@@ -84,9 +84,9 @@ class AsyncAITTSSettings(TTSSettings):
|
||||
output_sample_rate: Audio sample rate in Hz.
|
||||
"""
|
||||
|
||||
output_container: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
output_encoding: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
output_sample_rate: int = field(default_factory=lambda: NOT_GIVEN)
|
||||
output_container: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
output_encoding: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
output_sample_rate: int | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
@classmethod
|
||||
def from_mapping(cls, settings: Mapping[str, Any]) -> "AsyncAITTSSettings":
|
||||
|
||||
@@ -56,7 +56,7 @@ from pipecat.processors.aggregators.openai_llm_context import (
|
||||
)
|
||||
from pipecat.processors.frame_processor import FrameDirection
|
||||
from pipecat.services.llm_service import LLMService
|
||||
from pipecat.services.settings import NOT_GIVEN, LLMSettings
|
||||
from pipecat.services.settings import NOT_GIVEN, LLMSettings, _NotGiven
|
||||
from pipecat.utils.tracing.service_decorators import traced_llm
|
||||
|
||||
try:
|
||||
@@ -80,8 +80,10 @@ class AWSBedrockLLMSettings(LLMSettings):
|
||||
additional_model_request_fields: Additional model-specific parameters.
|
||||
"""
|
||||
|
||||
latency: Any = field(default_factory=lambda: NOT_GIVEN)
|
||||
additional_model_request_fields: Any = field(default_factory=lambda: NOT_GIVEN)
|
||||
latency: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
additional_model_request_fields: Dict[str, Any] | _NotGiven = field(
|
||||
default_factory=lambda: NOT_GIVEN
|
||||
)
|
||||
|
||||
|
||||
@dataclass
|
||||
|
||||
@@ -29,7 +29,7 @@ from pipecat.frames.frames import (
|
||||
TranscriptionFrame,
|
||||
)
|
||||
from pipecat.services.aws.utils import build_event_message, decode_event, get_presigned_url
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings, _NotGiven
|
||||
from pipecat.services.stt_latency import AWS_TRANSCRIBE_TTFS_P99
|
||||
from pipecat.services.stt_service import WebsocketSTTService
|
||||
from pipecat.transcriptions.language import Language, resolve_language
|
||||
@@ -57,11 +57,11 @@ class AWSTranscribeSTTSettings(STTSettings):
|
||||
enable_channel_identification: Whether to enable channel identification.
|
||||
"""
|
||||
|
||||
sample_rate: int = field(default_factory=lambda: NOT_GIVEN)
|
||||
media_encoding: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
number_of_channels: int = field(default_factory=lambda: NOT_GIVEN)
|
||||
show_speaker_label: bool = field(default_factory=lambda: NOT_GIVEN)
|
||||
enable_channel_identification: bool = field(default_factory=lambda: NOT_GIVEN)
|
||||
sample_rate: int | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
media_encoding: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
number_of_channels: int | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
show_speaker_label: bool | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
enable_channel_identification: bool | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
class AWSTranscribeSTTService(WebsocketSTTService):
|
||||
|
||||
@@ -25,7 +25,7 @@ from pipecat.frames.frames import (
|
||||
TTSStartedFrame,
|
||||
TTSStoppedFrame,
|
||||
)
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings, _NotGiven
|
||||
from pipecat.services.tts_service import TTSService
|
||||
from pipecat.transcriptions.language import Language, resolve_language
|
||||
from pipecat.utils.tracing.service_decorators import traced_tts
|
||||
@@ -135,11 +135,11 @@ class AWSPollyTTSSettings(TTSSettings):
|
||||
lexicon_names: List of pronunciation lexicons to apply.
|
||||
"""
|
||||
|
||||
engine: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
pitch: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
rate: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
volume: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
lexicon_names: List[str] = field(default_factory=lambda: NOT_GIVEN)
|
||||
engine: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
pitch: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
rate: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
volume: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
lexicon_names: List[str] | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
class AWSPollyTTSService(TTSService):
|
||||
|
||||
@@ -26,7 +26,7 @@ from pipecat.frames.frames import (
|
||||
TranscriptionFrame,
|
||||
)
|
||||
from pipecat.services.azure.common import language_to_azure_language
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings, _NotGiven
|
||||
from pipecat.services.stt_latency import AZURE_TTFS_P99
|
||||
from pipecat.services.stt_service import STTService
|
||||
from pipecat.transcriptions.language import Language
|
||||
@@ -59,8 +59,8 @@ class AzureSTTSettings(STTSettings):
|
||||
sample_rate: Audio sample rate in Hz.
|
||||
"""
|
||||
|
||||
region: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
sample_rate: Optional[int] = field(default_factory=lambda: NOT_GIVEN)
|
||||
region: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
sample_rate: int | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
class AzureSTTService(STTService):
|
||||
|
||||
@@ -26,7 +26,7 @@ from pipecat.frames.frames import (
|
||||
)
|
||||
from pipecat.processors.frame_processor import FrameDirection
|
||||
from pipecat.services.azure.common import language_to_azure_language
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings, _NotGiven
|
||||
from pipecat.services.tts_service import TTSService, WordTTSService
|
||||
from pipecat.transcriptions.language import Language
|
||||
from pipecat.utils.tracing.service_decorators import traced_tts
|
||||
@@ -82,14 +82,14 @@ class AzureTTSSettings(TTSSettings):
|
||||
volume: Volume level (e.g., "+20%", "loud", "x-soft").
|
||||
"""
|
||||
|
||||
emphasis: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
language: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
pitch: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
rate: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
role: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
style: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
style_degree: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
volume: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
emphasis: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
language: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
pitch: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
rate: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
role: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
style: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
style_degree: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
volume: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
class AzureBaseTTSService:
|
||||
|
||||
@@ -32,7 +32,7 @@ from pipecat.frames.frames import (
|
||||
TTSStartedFrame,
|
||||
TTSStoppedFrame,
|
||||
)
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings, _NotGiven
|
||||
from pipecat.services.tts_service import TTSService
|
||||
from pipecat.transcriptions.language import Language, resolve_language
|
||||
from pipecat.utils.tracing.service_decorators import traced_tts
|
||||
@@ -144,7 +144,7 @@ class CambTTSSettings(TTSSettings):
|
||||
Ignored for other models. Max 1000 characters.
|
||||
"""
|
||||
|
||||
user_instructions: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
user_instructions: str | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
class CambTTSService(TTSService):
|
||||
|
||||
@@ -28,7 +28,7 @@ from pipecat.frames.frames import (
|
||||
VADUserStoppedSpeakingFrame,
|
||||
)
|
||||
from pipecat.processors.frame_processor import FrameDirection
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings, _NotGiven
|
||||
from pipecat.services.stt_latency import CARTESIA_TTFS_P99
|
||||
from pipecat.services.stt_service import WebsocketSTTService
|
||||
from pipecat.transcriptions.language import Language
|
||||
@@ -52,7 +52,7 @@ class CartesiaSTTSettings(STTSettings):
|
||||
encoding: Audio encoding format (e.g. ``"pcm_s16le"``).
|
||||
"""
|
||||
|
||||
encoding: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
encoding: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
class CartesiaLiveOptions:
|
||||
|
||||
@@ -28,7 +28,7 @@ from pipecat.frames.frames import (
|
||||
TTSStoppedFrame,
|
||||
)
|
||||
from pipecat.processors.frame_processor import FrameDirection
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings, is_given
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings, _NotGiven, is_given
|
||||
from pipecat.services.tts_service import AudioContextWordTTSService, TTSService
|
||||
from pipecat.transcriptions.language import Language, resolve_language
|
||||
from pipecat.utils.text.base_text_aggregator import BaseTextAggregator
|
||||
@@ -209,13 +209,13 @@ class CartesiaTTSSettings(TTSSettings):
|
||||
custom pronunciations.
|
||||
"""
|
||||
|
||||
output_container: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
output_encoding: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
output_sample_rate: int = field(default_factory=lambda: NOT_GIVEN)
|
||||
speed: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
emotion: List[str] = field(default_factory=lambda: NOT_GIVEN)
|
||||
generation_config: GenerationConfig = field(default_factory=lambda: NOT_GIVEN)
|
||||
pronunciation_dict_id: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
output_container: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
output_encoding: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
output_sample_rate: int | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
speed: Literal["slow", "normal", "fast"] | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
emotion: List[str] | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
generation_config: GenerationConfig | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
pronunciation_dict_id: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
@classmethod
|
||||
def from_mapping(cls, settings: Mapping[str, Any]) -> "CartesiaTTSSettings":
|
||||
|
||||
@@ -24,7 +24,7 @@ from pipecat.frames.frames import (
|
||||
VADUserStoppedSpeakingFrame,
|
||||
)
|
||||
from pipecat.processors.frame_processor import FrameDirection
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings, is_given
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings, _NotGiven, is_given
|
||||
from pipecat.services.stt_latency import DEEPGRAM_TTFS_P99
|
||||
from pipecat.services.stt_service import STTService
|
||||
from pipecat.transcriptions.language import Language
|
||||
@@ -55,7 +55,7 @@ class DeepgramSTTSettings(STTSettings):
|
||||
live_options: Deepgram ``LiveOptions`` for detailed configuration.
|
||||
"""
|
||||
|
||||
live_options: LiveOptions = field(default_factory=lambda: NOT_GIVEN)
|
||||
live_options: LiveOptions | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
class DeepgramSTTService(STTService):
|
||||
|
||||
@@ -32,7 +32,7 @@ from pipecat.frames.frames import (
|
||||
)
|
||||
from pipecat.processors.frame_processor import FrameDirection
|
||||
from pipecat.services.aws.sagemaker.bidi_client import SageMakerBidiClient
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings, is_given
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings, _NotGiven, is_given
|
||||
from pipecat.services.stt_latency import DEEPGRAM_SAGEMAKER_TTFS_P99
|
||||
from pipecat.services.stt_service import STTService
|
||||
from pipecat.transcriptions.language import Language
|
||||
@@ -57,7 +57,7 @@ class DeepgramSageMakerSTTSettings(STTSettings):
|
||||
live_options: Deepgram ``LiveOptions`` for detailed configuration.
|
||||
"""
|
||||
|
||||
live_options: LiveOptions = field(default_factory=lambda: NOT_GIVEN)
|
||||
live_options: LiveOptions | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
class DeepgramSageMakerSTTService(STTService):
|
||||
|
||||
@@ -30,7 +30,7 @@ from pipecat.frames.frames import (
|
||||
TTSStoppedFrame,
|
||||
)
|
||||
from pipecat.processors.frame_processor import FrameDirection
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings, _NotGiven
|
||||
from pipecat.services.tts_service import TTSService, WebsocketTTSService
|
||||
from pipecat.utils.tracing.service_decorators import traced_tts
|
||||
|
||||
@@ -53,7 +53,7 @@ class DeepgramTTSSettings(TTSSettings):
|
||||
encoding: Audio encoding format (linear16, mulaw, alaw).
|
||||
"""
|
||||
|
||||
encoding: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
encoding: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
class DeepgramTTSService(WebsocketTTSService):
|
||||
|
||||
@@ -35,7 +35,7 @@ from pipecat.frames.frames import (
|
||||
VADUserStoppedSpeakingFrame,
|
||||
)
|
||||
from pipecat.processors.frame_processor import FrameDirection
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings, _NotGiven
|
||||
from pipecat.services.stt_latency import ELEVENLABS_REALTIME_TTFS_P99, ELEVENLABS_TTFS_P99
|
||||
from pipecat.services.stt_service import SegmentedSTTService, WebsocketSTTService
|
||||
from pipecat.transcriptions.language import Language, resolve_language
|
||||
@@ -185,7 +185,7 @@ class ElevenLabsSTTSettings(STTSettings):
|
||||
tag_audio_events: Whether to include audio event tags in transcription.
|
||||
"""
|
||||
|
||||
tag_audio_events: bool = field(default_factory=lambda: NOT_GIVEN)
|
||||
tag_audio_events: bool | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -205,14 +205,14 @@ class ElevenLabsRealtimeSTTSettings(STTSettings):
|
||||
include_language_detection: Whether to include language detection in transcripts.
|
||||
"""
|
||||
|
||||
commit_strategy: CommitStrategy = field(default_factory=lambda: NOT_GIVEN)
|
||||
vad_silence_threshold_secs: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
vad_threshold: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
min_speech_duration_ms: int = field(default_factory=lambda: NOT_GIVEN)
|
||||
min_silence_duration_ms: int = field(default_factory=lambda: NOT_GIVEN)
|
||||
include_timestamps: bool = field(default_factory=lambda: NOT_GIVEN)
|
||||
enable_logging: bool = field(default_factory=lambda: NOT_GIVEN)
|
||||
include_language_detection: bool = field(default_factory=lambda: NOT_GIVEN)
|
||||
commit_strategy: CommitStrategy | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
vad_silence_threshold_secs: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
vad_threshold: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
min_speech_duration_ms: int | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
min_silence_duration_ms: int | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
include_timestamps: bool | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
enable_logging: bool | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
include_language_detection: bool | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
class ElevenLabsSTTService(SegmentedSTTService):
|
||||
|
||||
@@ -44,7 +44,7 @@ from pipecat.frames.frames import (
|
||||
TTSStoppedFrame,
|
||||
)
|
||||
from pipecat.processors.frame_processor import FrameDirection
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings, is_given
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings, _NotGiven, is_given
|
||||
from pipecat.services.tts_service import (
|
||||
AudioContextWordTTSService,
|
||||
WordTTSService,
|
||||
@@ -206,15 +206,17 @@ class ElevenLabsTTSSettings(TTSSettings):
|
||||
apply_text_normalization: Text normalization mode ("auto", "on", "off").
|
||||
"""
|
||||
|
||||
stability: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
similarity_boost: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
style: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
use_speaker_boost: bool = field(default_factory=lambda: NOT_GIVEN)
|
||||
speed: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
auto_mode: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
enable_ssml_parsing: bool = field(default_factory=lambda: NOT_GIVEN)
|
||||
enable_logging: bool = field(default_factory=lambda: NOT_GIVEN)
|
||||
apply_text_normalization: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
stability: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
similarity_boost: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
style: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
use_speaker_boost: bool | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
speed: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
auto_mode: bool | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
enable_ssml_parsing: bool | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
enable_logging: bool | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
apply_text_normalization: Literal["auto", "on", "off"] | None | _NotGiven = field(
|
||||
default_factory=lambda: NOT_GIVEN
|
||||
)
|
||||
|
||||
#: Fields in the WS URL — changing any of these requires a reconnect.
|
||||
URL_FIELDS: ClassVar[frozenset[str]] = frozenset({"voice", "model", "language"})
|
||||
@@ -242,13 +244,15 @@ class ElevenLabsHttpTTSSettings(TTSSettings):
|
||||
apply_text_normalization: Text normalization mode ("auto", "on", "off").
|
||||
"""
|
||||
|
||||
optimize_streaming_latency: int = field(default_factory=lambda: NOT_GIVEN)
|
||||
stability: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
similarity_boost: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
style: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
use_speaker_boost: bool = field(default_factory=lambda: NOT_GIVEN)
|
||||
speed: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
apply_text_normalization: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
optimize_streaming_latency: int | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
stability: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
similarity_boost: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
style: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
use_speaker_boost: bool | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
speed: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
apply_text_normalization: Literal["auto", "on", "off"] | None | _NotGiven = field(
|
||||
default_factory=lambda: NOT_GIVEN
|
||||
)
|
||||
|
||||
_aliases: ClassVar[Dict[str, str]] = {"voice_id": "voice"}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ from loguru import logger
|
||||
from pydantic import BaseModel
|
||||
|
||||
from pipecat.frames.frames import ErrorFrame, Frame, TranscriptionFrame
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings, _NotGiven
|
||||
from pipecat.services.stt_latency import FAL_TTFS_P99
|
||||
from pipecat.services.stt_service import SegmentedSTTService
|
||||
from pipecat.transcriptions.language import Language, resolve_language
|
||||
@@ -159,9 +159,9 @@ class FalSTTSettings(STTSettings):
|
||||
version: Version of Wizper model to use. Defaults to '3'.
|
||||
"""
|
||||
|
||||
task: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
chunk_level: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
version: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
task: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
chunk_level: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
version: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
class FalSTTService(SegmentedSTTService):
|
||||
|
||||
@@ -29,7 +29,7 @@ from pipecat.frames.frames import (
|
||||
TTSStoppedFrame,
|
||||
)
|
||||
from pipecat.processors.frame_processor import FrameDirection
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings, _NotGiven
|
||||
from pipecat.services.tts_service import InterruptibleTTSService
|
||||
from pipecat.transcriptions.language import Language
|
||||
from pipecat.utils.tracing.service_decorators import traced_tts
|
||||
@@ -61,13 +61,13 @@ class FishAudioTTSSettings(TTSSettings):
|
||||
reference_id: Reference ID of the voice model.
|
||||
"""
|
||||
|
||||
fish_sample_rate: int = field(default_factory=lambda: NOT_GIVEN)
|
||||
latency: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
format: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
normalize: bool = field(default_factory=lambda: NOT_GIVEN)
|
||||
prosody_speed: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
prosody_volume: int = field(default_factory=lambda: NOT_GIVEN)
|
||||
reference_id: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
fish_sample_rate: int | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
latency: str | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
format: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
normalize: bool | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
prosody_speed: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
prosody_volume: int | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
reference_id: str | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
_aliases: ClassVar[Dict[str, str]] = {"voice_id": "voice", "sample_rate": "fish_sample_rate"}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ from pipecat.frames.frames import (
|
||||
UserStoppedSpeakingFrame,
|
||||
)
|
||||
from pipecat.services.gladia.config import GladiaInputParams
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings, _NotGiven
|
||||
from pipecat.services.stt_latency import GLADIA_TTFS_P99
|
||||
from pipecat.services.stt_service import WebsocketSTTService
|
||||
from pipecat.transcriptions.language import Language, resolve_language
|
||||
@@ -188,7 +188,7 @@ class GladiaSTTSettings(STTSettings):
|
||||
input_params: Gladia ``GladiaInputParams`` for detailed configuration.
|
||||
"""
|
||||
|
||||
input_params: GladiaInputParams = field(default_factory=lambda: NOT_GIVEN)
|
||||
input_params: GladiaInputParams | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
class GladiaSTTService(WebsocketSTTService):
|
||||
|
||||
@@ -76,7 +76,7 @@ from pipecat.services.openai.llm import (
|
||||
OpenAIAssistantContextAggregator,
|
||||
OpenAIUserContextAggregator,
|
||||
)
|
||||
from pipecat.services.settings import NOT_GIVEN, LLMSettings
|
||||
from pipecat.services.settings import NOT_GIVEN, LLMSettings, _NotGiven
|
||||
from pipecat.transcriptions.language import Language, resolve_language
|
||||
from pipecat.utils.string import match_endofsentence
|
||||
from pipecat.utils.time import time_now_iso8601
|
||||
@@ -617,14 +617,16 @@ class GeminiLiveLLMSettings(LLMSettings):
|
||||
proactivity: Proactivity configuration.
|
||||
"""
|
||||
|
||||
modalities: Any = field(default_factory=lambda: NOT_GIVEN)
|
||||
language: Any = field(default_factory=lambda: NOT_GIVEN)
|
||||
media_resolution: Any = field(default_factory=lambda: NOT_GIVEN)
|
||||
vad: Any = field(default_factory=lambda: NOT_GIVEN)
|
||||
context_window_compression: Any = field(default_factory=lambda: NOT_GIVEN)
|
||||
thinking: Any = field(default_factory=lambda: NOT_GIVEN)
|
||||
enable_affective_dialog: Any = field(default_factory=lambda: NOT_GIVEN)
|
||||
proactivity: Any = field(default_factory=lambda: NOT_GIVEN)
|
||||
modalities: GeminiModalities | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
language: Language | str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
media_resolution: GeminiMediaResolution | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
vad: GeminiVADParams | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
context_window_compression: ContextWindowCompressionParams | dict | _NotGiven = field(
|
||||
default_factory=lambda: NOT_GIVEN
|
||||
)
|
||||
thinking: ThinkingConfig | dict | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
enable_affective_dialog: bool | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
proactivity: ProactivityConfig | dict | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
class GeminiLiveLLMService(LLMService):
|
||||
|
||||
@@ -58,7 +58,7 @@ from pipecat.services.openai.llm import (
|
||||
OpenAIAssistantContextAggregator,
|
||||
OpenAIUserContextAggregator,
|
||||
)
|
||||
from pipecat.services.settings import NOT_GIVEN, LLMSettings, is_given
|
||||
from pipecat.services.settings import NOT_GIVEN, LLMSettings, _NotGiven, is_given
|
||||
from pipecat.utils.tracing.service_decorators import traced_llm
|
||||
|
||||
# Suppress gRPC fork warnings
|
||||
@@ -681,7 +681,9 @@ class GoogleLLMSettings(LLMSettings):
|
||||
thinking: Thinking configuration.
|
||||
"""
|
||||
|
||||
thinking: Any = field(default_factory=lambda: NOT_GIVEN)
|
||||
thinking: "GoogleLLMService.ThinkingConfig" | _NotGiven = field(
|
||||
default_factory=lambda: NOT_GIVEN
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def from_mapping(cls, settings):
|
||||
|
||||
@@ -36,7 +36,7 @@ from pipecat.frames.frames import (
|
||||
StartFrame,
|
||||
TranscriptionFrame,
|
||||
)
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings, _NotGiven
|
||||
from pipecat.services.stt_latency import GOOGLE_TTFS_P99
|
||||
from pipecat.services.stt_service import STTService
|
||||
from pipecat.transcriptions.language import Language, resolve_language
|
||||
@@ -383,17 +383,19 @@ class GoogleSTTSettings(STTSettings):
|
||||
enable_voice_activity_events: Detect voice activity in audio.
|
||||
"""
|
||||
|
||||
languages: Any = field(default_factory=lambda: NOT_GIVEN)
|
||||
language_codes: Any = field(default_factory=lambda: NOT_GIVEN)
|
||||
use_separate_recognition_per_channel: Any = field(default_factory=lambda: NOT_GIVEN)
|
||||
enable_automatic_punctuation: Any = field(default_factory=lambda: NOT_GIVEN)
|
||||
enable_spoken_punctuation: Any = field(default_factory=lambda: NOT_GIVEN)
|
||||
enable_spoken_emojis: Any = field(default_factory=lambda: NOT_GIVEN)
|
||||
profanity_filter: Any = field(default_factory=lambda: NOT_GIVEN)
|
||||
enable_word_time_offsets: Any = field(default_factory=lambda: NOT_GIVEN)
|
||||
enable_word_confidence: Any = field(default_factory=lambda: NOT_GIVEN)
|
||||
enable_interim_results: Any = field(default_factory=lambda: NOT_GIVEN)
|
||||
enable_voice_activity_events: Any = field(default_factory=lambda: NOT_GIVEN)
|
||||
languages: List[Language] | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
language_codes: List[str] | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
use_separate_recognition_per_channel: bool | _NotGiven = field(
|
||||
default_factory=lambda: NOT_GIVEN
|
||||
)
|
||||
enable_automatic_punctuation: bool | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
enable_spoken_punctuation: bool | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
enable_spoken_emojis: bool | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
profanity_filter: bool | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
enable_word_time_offsets: bool | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
enable_word_confidence: bool | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
enable_interim_results: bool | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
enable_voice_activity_events: bool | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
class GoogleSTTService(STTService):
|
||||
|
||||
@@ -24,7 +24,7 @@ from pipecat.utils.tracing.service_decorators import traced_tts
|
||||
os.environ["GRPC_ENABLE_FORK_SUPPORT"] = "false"
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Any, AsyncGenerator, List, Literal, Optional
|
||||
from typing import Any, AsyncGenerator, Dict, List, Literal, Optional
|
||||
|
||||
from loguru import logger
|
||||
from pydantic import BaseModel
|
||||
@@ -37,7 +37,7 @@ from pipecat.frames.frames import (
|
||||
TTSStartedFrame,
|
||||
TTSStoppedFrame,
|
||||
)
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings, is_given
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings, _NotGiven, is_given
|
||||
from pipecat.services.tts_service import TTSService
|
||||
from pipecat.transcriptions.language import Language, resolve_language
|
||||
|
||||
@@ -493,14 +493,20 @@ class GoogleHttpTTSSettings(TTSSettings):
|
||||
google_style: Google-specific voice style.
|
||||
"""
|
||||
|
||||
pitch: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
rate: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
speaking_rate: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
volume: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
emphasis: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
language: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
gender: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
google_style: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
pitch: str | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
rate: str | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
speaking_rate: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
volume: str | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
emphasis: Literal["strong", "moderate", "reduced", "none"] | None | _NotGiven = field(
|
||||
default_factory=lambda: NOT_GIVEN
|
||||
)
|
||||
language: str | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
gender: Literal["male", "female", "neutral"] | None | _NotGiven = field(
|
||||
default_factory=lambda: NOT_GIVEN
|
||||
)
|
||||
google_style: (
|
||||
Literal["apologetic", "calm", "empathetic", "firm", "lively"] | None | _NotGiven
|
||||
) = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -512,8 +518,8 @@ class GoogleStreamTTSSettings(TTSSettings):
|
||||
speaking_rate: The speaking rate, in the range [0.25, 2.0].
|
||||
"""
|
||||
|
||||
language: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
speaking_rate: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
language: str | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
speaking_rate: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -527,10 +533,12 @@ class GeminiTTSSettings(TTSSettings):
|
||||
speaker_configs: List of speaker configurations for multi-speaker mode.
|
||||
"""
|
||||
|
||||
language: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
prompt: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
multi_speaker: bool = field(default_factory=lambda: NOT_GIVEN)
|
||||
speaker_configs: List[dict] = field(default_factory=lambda: NOT_GIVEN)
|
||||
language: str | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
prompt: str | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
multi_speaker: bool | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
speaker_configs: list[dict[str, Any]] | None | _NotGiven = field(
|
||||
default_factory=lambda: NOT_GIVEN
|
||||
)
|
||||
|
||||
|
||||
class GoogleHttpTTSService(TTSService):
|
||||
|
||||
@@ -28,7 +28,7 @@ from pipecat.frames.frames import (
|
||||
VADUserStoppedSpeakingFrame,
|
||||
)
|
||||
from pipecat.processors.frame_processor import FrameDirection
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings, is_given
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings, _NotGiven, is_given
|
||||
from pipecat.services.stt_latency import GRADIUM_TTFS_P99
|
||||
from pipecat.services.stt_service import WebsocketSTTService
|
||||
from pipecat.transcriptions.language import Language, resolve_language
|
||||
@@ -75,7 +75,7 @@ class GradiumSTTSettings(STTSettings):
|
||||
generated. Higher delays allow more context but increase latency.
|
||||
"""
|
||||
|
||||
delay_in_frames: int = field(default_factory=lambda: NOT_GIVEN)
|
||||
delay_in_frames: int | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
class GradiumSTTService(WebsocketSTTService):
|
||||
|
||||
@@ -23,7 +23,7 @@ from pipecat.frames.frames import (
|
||||
TTSStoppedFrame,
|
||||
)
|
||||
from pipecat.processors.frame_processor import FrameDirection
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings, _NotGiven
|
||||
from pipecat.services.tts_service import InterruptibleWordTTSService
|
||||
from pipecat.utils.tracing.service_decorators import traced_tts
|
||||
|
||||
@@ -47,7 +47,7 @@ class GradiumTTSSettings(TTSSettings):
|
||||
output_format: Audio output format.
|
||||
"""
|
||||
|
||||
output_format: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
output_format: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
class GradiumTTSService(InterruptibleWordTTSService):
|
||||
|
||||
@@ -21,7 +21,7 @@ from pipecat.frames.frames import (
|
||||
TTSStartedFrame,
|
||||
TTSStoppedFrame,
|
||||
)
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings, _NotGiven
|
||||
from pipecat.services.tts_service import TTSService
|
||||
from pipecat.transcriptions.language import Language
|
||||
from pipecat.utils.tracing.service_decorators import traced_tts
|
||||
@@ -44,9 +44,9 @@ class GroqTTSSettings(TTSSettings):
|
||||
groq_sample_rate: Audio sample rate.
|
||||
"""
|
||||
|
||||
output_format: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
speed: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
groq_sample_rate: int = field(default_factory=lambda: NOT_GIVEN)
|
||||
output_format: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
speed: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
groq_sample_rate: int | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
_aliases: ClassVar[Dict[str, str]] = {"voice_id": "voice", "sample_rate": "groq_sample_rate"}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ from pipecat.frames.frames import (
|
||||
Frame,
|
||||
TranscriptionFrame,
|
||||
)
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings, _NotGiven
|
||||
from pipecat.services.stt_latency import HATHORA_TTFS_P99
|
||||
from pipecat.services.stt_service import SegmentedSTTService
|
||||
from pipecat.transcriptions.language import Language
|
||||
@@ -39,7 +39,7 @@ class HathoraSTTSettings(STTSettings):
|
||||
what is supported.
|
||||
"""
|
||||
|
||||
config: Optional[list] = field(default_factory=lambda: NOT_GIVEN)
|
||||
config: list[ConfigOption] | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
class HathoraSTTService(SegmentedSTTService):
|
||||
|
||||
@@ -22,7 +22,7 @@ from pipecat.frames.frames import (
|
||||
TTSStartedFrame,
|
||||
TTSStoppedFrame,
|
||||
)
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings, _NotGiven
|
||||
from pipecat.services.tts_service import TTSService
|
||||
from pipecat.utils.tracing.service_decorators import traced_tts
|
||||
|
||||
@@ -58,8 +58,8 @@ class HathoraTTSSettings(TTSSettings):
|
||||
what is supported.
|
||||
"""
|
||||
|
||||
speed: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
config: list = field(default_factory=lambda: NOT_GIVEN)
|
||||
speed: float | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
config: list[ConfigOption] | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
class HathoraTTSService(TTSService):
|
||||
|
||||
@@ -24,7 +24,7 @@ import websockets
|
||||
from loguru import logger
|
||||
from pydantic import BaseModel
|
||||
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings, is_given
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings, _NotGiven, is_given
|
||||
|
||||
try:
|
||||
from websockets.asyncio.client import connect as websocket_connect
|
||||
@@ -67,12 +67,12 @@ class InworldTTSSettings(TTSSettings):
|
||||
apply_text_normalization: Whether to apply text normalization.
|
||||
"""
|
||||
|
||||
audio_encoding: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
audio_sample_rate: int = field(default_factory=lambda: NOT_GIVEN)
|
||||
speaking_rate: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
temperature: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
auto_mode: bool = field(default_factory=lambda: NOT_GIVEN)
|
||||
apply_text_normalization: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
audio_encoding: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
audio_sample_rate: int | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
speaking_rate: float | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
temperature: float | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
auto_mode: bool | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
apply_text_normalization: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
_aliases: ClassVar[Dict[str, str]] = {
|
||||
"voice_id": "voice",
|
||||
|
||||
@@ -23,7 +23,7 @@ from pipecat.frames.frames import (
|
||||
TTSStartedFrame,
|
||||
TTSStoppedFrame,
|
||||
)
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings, _NotGiven
|
||||
from pipecat.services.tts_service import TTSService
|
||||
from pipecat.transcriptions.language import Language, resolve_language
|
||||
from pipecat.utils.tracing.service_decorators import traced_tts
|
||||
@@ -97,7 +97,7 @@ class KokoroTTSSettings(TTSSettings):
|
||||
lang_code: Kokoro language code for synthesis.
|
||||
"""
|
||||
|
||||
lang_code: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
lang_code: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
class KokoroTTSService(TTSService):
|
||||
|
||||
@@ -24,7 +24,7 @@ from pipecat.frames.frames import (
|
||||
TTSStoppedFrame,
|
||||
)
|
||||
from pipecat.processors.frame_processor import FrameDirection
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings, _NotGiven
|
||||
from pipecat.services.tts_service import InterruptibleTTSService
|
||||
from pipecat.transcriptions.language import Language, resolve_language
|
||||
from pipecat.utils.tracing.service_decorators import traced_tts
|
||||
@@ -81,7 +81,7 @@ class LmntTTSSettings(TTSSettings):
|
||||
format: Audio output format. Defaults to "raw".
|
||||
"""
|
||||
|
||||
format: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
format: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
class LmntTTSService(InterruptibleTTSService):
|
||||
|
||||
@@ -26,7 +26,7 @@ from pipecat.frames.frames import (
|
||||
TTSStartedFrame,
|
||||
TTSStoppedFrame,
|
||||
)
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings, is_given
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings, _NotGiven, is_given
|
||||
from pipecat.services.tts_service import TTSService
|
||||
from pipecat.transcriptions.language import Language, resolve_language
|
||||
from pipecat.utils.tracing.service_decorators import traced_tts
|
||||
@@ -107,18 +107,18 @@ class MiniMaxTTSSettings(TTSSettings):
|
||||
language_boost: Language boost string for multilingual support.
|
||||
"""
|
||||
|
||||
stream: bool = field(default_factory=lambda: NOT_GIVEN)
|
||||
speed: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
volume: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
pitch: int = field(default_factory=lambda: NOT_GIVEN)
|
||||
emotion: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
text_normalization: bool = field(default_factory=lambda: NOT_GIVEN)
|
||||
latex_read: bool = field(default_factory=lambda: NOT_GIVEN)
|
||||
audio_bitrate: int = field(default_factory=lambda: NOT_GIVEN)
|
||||
audio_format: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
audio_channel: int = field(default_factory=lambda: NOT_GIVEN)
|
||||
audio_sample_rate: int = field(default_factory=lambda: NOT_GIVEN)
|
||||
language_boost: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
stream: bool | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
speed: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
volume: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
pitch: int | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
emotion: str | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
text_normalization: bool | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
latex_read: bool | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
audio_bitrate: int | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
audio_format: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
audio_channel: int | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
audio_sample_rate: int | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
language_boost: str | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
_aliases: ClassVar[Dict[str, str]] = {"voice_id": "voice"}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ from pipecat.frames.frames import (
|
||||
TTSStoppedFrame,
|
||||
)
|
||||
from pipecat.processors.frame_processor import FrameDirection
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings, _NotGiven
|
||||
from pipecat.services.tts_service import InterruptibleTTSService, TTSService
|
||||
from pipecat.transcriptions.language import Language, resolve_language
|
||||
from pipecat.utils.tracing.service_decorators import traced_tts
|
||||
@@ -85,10 +85,10 @@ class NeuphonicTTSSettings(TTSSettings):
|
||||
sampling_rate: Audio sample rate.
|
||||
"""
|
||||
|
||||
lang_code: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
speed: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
encoding: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
sampling_rate: int = field(default_factory=lambda: NOT_GIVEN)
|
||||
lang_code: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
speed: float | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
encoding: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
sampling_rate: int | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
class NeuphonicTTSService(InterruptibleTTSService):
|
||||
|
||||
@@ -23,7 +23,7 @@ from pipecat.frames.frames import (
|
||||
StartFrame,
|
||||
TranscriptionFrame,
|
||||
)
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings, _NotGiven
|
||||
from pipecat.services.stt_latency import NVIDIA_TTFS_P99
|
||||
from pipecat.services.stt_service import SegmentedSTTService, STTService
|
||||
from pipecat.transcriptions.language import Language, resolve_language
|
||||
@@ -110,11 +110,11 @@ class NvidiaSegmentedSTTSettings(STTSettings):
|
||||
boosted_lm_score: Score boost for specified words.
|
||||
"""
|
||||
|
||||
profanity_filter: bool = field(default_factory=lambda: NOT_GIVEN)
|
||||
automatic_punctuation: bool = field(default_factory=lambda: NOT_GIVEN)
|
||||
verbatim_transcripts: bool = field(default_factory=lambda: NOT_GIVEN)
|
||||
boosted_lm_words: Optional[List[str]] = field(default_factory=lambda: NOT_GIVEN)
|
||||
boosted_lm_score: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
profanity_filter: bool | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
automatic_punctuation: bool | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
verbatim_transcripts: bool | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
boosted_lm_words: List[str] | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
boosted_lm_score: float | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
class NvidiaSTTService(STTService):
|
||||
|
||||
@@ -43,7 +43,7 @@ from pipecat.processors.aggregators.openai_llm_context import (
|
||||
from pipecat.processors.frame_processor import FrameDirection
|
||||
from pipecat.services.llm_service import FunctionCallFromLLM, LLMService
|
||||
from pipecat.services.settings import NOT_GIVEN as _NOT_GIVEN
|
||||
from pipecat.services.settings import LLMSettings
|
||||
from pipecat.services.settings import LLMSettings, _NotGiven
|
||||
from pipecat.utils.tracing.service_decorators import traced_llm
|
||||
|
||||
|
||||
@@ -56,8 +56,8 @@ class OpenAILLMSettings(LLMSettings):
|
||||
service_tier: Service tier to use (e.g., "auto", "flex", "priority").
|
||||
"""
|
||||
|
||||
max_completion_tokens: Any = field(default_factory=lambda: _NOT_GIVEN)
|
||||
service_tier: Any = field(default_factory=lambda: _NOT_GIVEN)
|
||||
max_completion_tokens: int | _NotGiven = field(default_factory=lambda: _NOT_GIVEN)
|
||||
service_tier: str | _NotGiven = field(default_factory=lambda: _NOT_GIVEN)
|
||||
|
||||
|
||||
class BaseOpenAILLMService(LLMService):
|
||||
|
||||
@@ -35,7 +35,7 @@ from pipecat.frames.frames import (
|
||||
VADUserStoppedSpeakingFrame,
|
||||
)
|
||||
from pipecat.processors.frame_processor import FrameDirection
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings, is_given
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings, _NotGiven, is_given
|
||||
from pipecat.services.stt_latency import OPENAI_REALTIME_TTFS_P99, OPENAI_TTFS_P99
|
||||
from pipecat.services.stt_service import WebsocketSTTService
|
||||
from pipecat.services.whisper.base_stt import BaseWhisperSTTService, Transcription
|
||||
@@ -133,7 +133,7 @@ class OpenAIRealtimeSTTSettings(STTSettings):
|
||||
prompt: Optional prompt text to guide transcription style.
|
||||
"""
|
||||
|
||||
prompt: Optional[str] = field(default_factory=lambda: NOT_GIVEN)
|
||||
prompt: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
class OpenAIRealtimeSTTService(WebsocketSTTService):
|
||||
|
||||
@@ -25,7 +25,7 @@ from pipecat.frames.frames import (
|
||||
TTSStartedFrame,
|
||||
TTSStoppedFrame,
|
||||
)
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings, _NotGiven
|
||||
from pipecat.services.tts_service import TTSService
|
||||
from pipecat.utils.tracing.service_decorators import traced_tts
|
||||
|
||||
@@ -71,8 +71,8 @@ class OpenAITTSSettings(TTSSettings):
|
||||
speed: Voice speed control (0.25 to 4.0, default 1.0).
|
||||
"""
|
||||
|
||||
instructions: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
speed: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
instructions: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
speed: float | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
class OpenAITTSService(TTSService):
|
||||
|
||||
@@ -11,7 +11,7 @@ import json
|
||||
import time
|
||||
import warnings
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Any, Optional
|
||||
from typing import Optional
|
||||
|
||||
from loguru import logger
|
||||
|
||||
@@ -54,7 +54,7 @@ from pipecat.processors.aggregators.openai_llm_context import (
|
||||
from pipecat.processors.frame_processor import FrameDirection
|
||||
from pipecat.services.llm_service import FunctionCallFromLLM, LLMService
|
||||
from pipecat.services.openai.llm import OpenAIContextAggregatorPair
|
||||
from pipecat.services.settings import NOT_GIVEN, LLMSettings
|
||||
from pipecat.services.settings import NOT_GIVEN, LLMSettings, _NotGiven
|
||||
from pipecat.transcriptions.language import Language
|
||||
from pipecat.utils.time import time_now_iso8601
|
||||
from pipecat.utils.tracing.service_decorators import traced_openai_realtime, traced_stt
|
||||
@@ -100,7 +100,9 @@ class OpenAIRealtimeBetaLLMSettings(LLMSettings):
|
||||
session_properties: OpenAI Realtime session configuration.
|
||||
"""
|
||||
|
||||
session_properties: Any = field(default_factory=lambda: NOT_GIVEN)
|
||||
session_properties: events.SessionProperties | _NotGiven = field(
|
||||
default_factory=lambda: NOT_GIVEN
|
||||
)
|
||||
|
||||
|
||||
class OpenAIRealtimeBetaLLMService(LLMService):
|
||||
|
||||
@@ -33,7 +33,7 @@ from pipecat.frames.frames import (
|
||||
TTSStoppedFrame,
|
||||
)
|
||||
from pipecat.processors.frame_processor import FrameDirection
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings, is_given
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings, _NotGiven, is_given
|
||||
from pipecat.services.tts_service import InterruptibleTTSService, TTSService
|
||||
from pipecat.transcriptions.language import Language, resolve_language
|
||||
from pipecat.utils.tracing.service_decorators import traced_tts
|
||||
@@ -111,11 +111,11 @@ class PlayHTTTSSettings(TTSSettings):
|
||||
playht_sample_rate: Audio sample rate sent to the API.
|
||||
"""
|
||||
|
||||
output_format: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
voice_engine: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
speed: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
seed: int = field(default_factory=lambda: NOT_GIVEN)
|
||||
playht_sample_rate: int = field(default_factory=lambda: NOT_GIVEN)
|
||||
output_format: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
voice_engine: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
speed: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
seed: int | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
playht_sample_rate: int | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
class PlayHTTTSService(InterruptibleTTSService):
|
||||
|
||||
@@ -25,7 +25,7 @@ from pipecat.frames.frames import (
|
||||
TTSStoppedFrame,
|
||||
)
|
||||
from pipecat.processors.frame_processor import FrameDirection
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings, _NotGiven
|
||||
from pipecat.services.tts_service import AudioContextWordTTSService
|
||||
from pipecat.transcriptions.language import Language
|
||||
from pipecat.utils.text.base_text_aggregator import BaseTextAggregator
|
||||
@@ -50,9 +50,9 @@ class ResembleAITTSSettings(TTSSettings):
|
||||
resemble_sample_rate: Audio sample rate sent to the API.
|
||||
"""
|
||||
|
||||
precision: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
output_format: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
resemble_sample_rate: int = field(default_factory=lambda: NOT_GIVEN)
|
||||
precision: str | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
output_format: str | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
resemble_sample_rate: int | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
_aliases: ClassVar[Dict[str, str]] = {
|
||||
"voice_id": "voice",
|
||||
|
||||
@@ -31,7 +31,7 @@ from pipecat.frames.frames import (
|
||||
TTSStoppedFrame,
|
||||
)
|
||||
from pipecat.processors.frame_processor import FrameDirection
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings, is_given
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings, _NotGiven, is_given
|
||||
from pipecat.services.tts_service import (
|
||||
AudioContextWordTTSService,
|
||||
InterruptibleTTSService,
|
||||
@@ -86,15 +86,15 @@ class RimeTTSSettings(TTSSettings):
|
||||
inlineSpeedAlpha: Inline speed control markup.
|
||||
"""
|
||||
|
||||
modelId: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
audioFormat: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
samplingRate: int = field(default_factory=lambda: NOT_GIVEN)
|
||||
lang: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
speedAlpha: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
reduceLatency: bool = field(default_factory=lambda: NOT_GIVEN)
|
||||
pauseBetweenBrackets: bool = field(default_factory=lambda: NOT_GIVEN)
|
||||
phonemizeBetweenBrackets: bool = field(default_factory=lambda: NOT_GIVEN)
|
||||
inlineSpeedAlpha: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
modelId: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
audioFormat: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
samplingRate: int | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
lang: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
speedAlpha: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
reduceLatency: bool | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
pauseBetweenBrackets: bool | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
phonemizeBetweenBrackets: bool | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
inlineSpeedAlpha: str | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
_aliases: ClassVar[Dict[str, str]] = {"speaker": "voice"}
|
||||
|
||||
@@ -114,14 +114,14 @@ class RimeNonJsonTTSSettings(TTSSettings):
|
||||
top_p: Cumulative probability threshold (0.0-1.0).
|
||||
"""
|
||||
|
||||
modelId: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
audioFormat: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
samplingRate: int = field(default_factory=lambda: NOT_GIVEN)
|
||||
lang: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
segment: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
repetition_penalty: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
temperature: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
top_p: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
modelId: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
audioFormat: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
samplingRate: int | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
lang: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
segment: str | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
repetition_penalty: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
temperature: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
top_p: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
_aliases: ClassVar[Dict[str, str]] = {"speaker": "voice"}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ from pipecat.frames.frames import (
|
||||
)
|
||||
from pipecat.processors.frame_processor import FrameDirection
|
||||
from pipecat.services.sarvam._sdk import sdk_headers
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings, is_given
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings, _NotGiven, is_given
|
||||
from pipecat.services.stt_latency import SARVAM_TTFS_P99
|
||||
from pipecat.services.stt_service import STTService
|
||||
from pipecat.transcriptions.language import Language, resolve_language
|
||||
@@ -142,10 +142,10 @@ class SarvamSTTSettings(STTSettings):
|
||||
high_vad_sensitivity: Enable high VAD sensitivity.
|
||||
"""
|
||||
|
||||
prompt: Optional[str] = field(default_factory=lambda: NOT_GIVEN)
|
||||
mode: Optional[str] = field(default_factory=lambda: NOT_GIVEN)
|
||||
vad_signals: Optional[bool] = field(default_factory=lambda: NOT_GIVEN)
|
||||
high_vad_sensitivity: Optional[bool] = field(default_factory=lambda: NOT_GIVEN)
|
||||
prompt: str | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
mode: str | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
vad_signals: bool | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
high_vad_sensitivity: bool | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
class SarvamSTTService(STTService):
|
||||
|
||||
@@ -62,7 +62,7 @@ from pipecat.frames.frames import (
|
||||
)
|
||||
from pipecat.processors.frame_processor import FrameDirection
|
||||
from pipecat.services.sarvam._sdk import sdk_headers
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings, is_given
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings, _NotGiven, is_given
|
||||
from pipecat.services.tts_service import InterruptibleTTSService, TTSService
|
||||
from pipecat.transcriptions.language import Language, resolve_language
|
||||
from pipecat.utils.tracing.service_decorators import traced_tts
|
||||
@@ -266,13 +266,13 @@ class SarvamHttpTTSSettings(TTSSettings):
|
||||
sample_rate: Audio sample rate.
|
||||
"""
|
||||
|
||||
language: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
enable_preprocessing: bool = field(default_factory=lambda: NOT_GIVEN)
|
||||
pace: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
pitch: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
loudness: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
temperature: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
sarvam_sample_rate: int = field(default_factory=lambda: NOT_GIVEN)
|
||||
language: str | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
enable_preprocessing: bool | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
pace: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
pitch: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
loudness: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
temperature: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
sarvam_sample_rate: int | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -305,18 +305,18 @@ class SarvamTTSSettings(TTSSettings):
|
||||
**Note:** Only supported for bulbul:v3-beta. Ignored for v2.
|
||||
"""
|
||||
|
||||
target_language_code: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
speaker: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
speech_sample_rate: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
enable_preprocessing: bool = field(default_factory=lambda: NOT_GIVEN)
|
||||
min_buffer_size: int = field(default_factory=lambda: NOT_GIVEN)
|
||||
max_chunk_length: int = field(default_factory=lambda: NOT_GIVEN)
|
||||
output_audio_codec: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
output_audio_bitrate: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
pace: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
pitch: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
loudness: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
temperature: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
target_language_code: str | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
speaker: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
speech_sample_rate: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
enable_preprocessing: bool | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
min_buffer_size: int | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
max_chunk_length: int | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
output_audio_codec: str | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
output_audio_bitrate: str | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
pace: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
pitch: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
loudness: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
temperature: float | None | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
class SarvamHttpTTSService(TTSService):
|
||||
|
||||
@@ -24,7 +24,7 @@ from pipecat.frames.frames import (
|
||||
VADUserStoppedSpeakingFrame,
|
||||
)
|
||||
from pipecat.processors.frame_processor import FrameDirection
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings, is_given
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings, _NotGiven, is_given
|
||||
from pipecat.services.stt_latency import SONIOX_TTFS_P99
|
||||
from pipecat.services.stt_service import WebsocketSTTService
|
||||
from pipecat.transcriptions.language import Language
|
||||
@@ -144,7 +144,7 @@ class SonioxSTTSettings(STTSettings):
|
||||
input_params: Soniox ``SonioxInputParams`` for detailed configuration.
|
||||
"""
|
||||
|
||||
input_params: SonioxInputParams = field(default_factory=lambda: NOT_GIVEN)
|
||||
input_params: SonioxInputParams | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
class SonioxSTTService(WebsocketSTTService):
|
||||
|
||||
@@ -33,7 +33,7 @@ from pipecat.frames.frames import (
|
||||
VADUserStoppedSpeakingFrame,
|
||||
)
|
||||
from pipecat.processors.frame_processor import FrameDirection
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings, is_given
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings, _NotGiven, is_given
|
||||
from pipecat.services.stt_latency import SPEECHMATICS_TTFS_P99
|
||||
from pipecat.services.stt_service import STTService
|
||||
from pipecat.transcriptions.language import Language, resolve_language
|
||||
@@ -115,28 +115,30 @@ class SpeechmaticsSTTSettings(STTSettings):
|
||||
extra_params: Extra parameters for the STT engine.
|
||||
"""
|
||||
|
||||
domain: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
turn_detection_mode: TurnDetectionMode = field(default_factory=lambda: NOT_GIVEN)
|
||||
speaker_active_format: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
speaker_passive_format: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
focus_speakers: list = field(default_factory=lambda: NOT_GIVEN)
|
||||
ignore_speakers: list = field(default_factory=lambda: NOT_GIVEN)
|
||||
focus_mode: Any = field(default_factory=lambda: NOT_GIVEN)
|
||||
known_speakers: list = field(default_factory=lambda: NOT_GIVEN)
|
||||
additional_vocab: list = field(default_factory=lambda: NOT_GIVEN)
|
||||
audio_encoding: Any = field(default_factory=lambda: NOT_GIVEN)
|
||||
operating_point: Any = field(default_factory=lambda: NOT_GIVEN)
|
||||
max_delay: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
end_of_utterance_silence_trigger: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
end_of_utterance_max_delay: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
punctuation_overrides: dict = field(default_factory=lambda: NOT_GIVEN)
|
||||
include_partials: bool = field(default_factory=lambda: NOT_GIVEN)
|
||||
split_sentences: bool = field(default_factory=lambda: NOT_GIVEN)
|
||||
enable_diarization: bool = field(default_factory=lambda: NOT_GIVEN)
|
||||
speaker_sensitivity: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
max_speakers: int = field(default_factory=lambda: NOT_GIVEN)
|
||||
prefer_current_speaker: bool = field(default_factory=lambda: NOT_GIVEN)
|
||||
extra_params: dict = field(default_factory=lambda: NOT_GIVEN)
|
||||
domain: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
turn_detection_mode: TurnDetectionMode | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
speaker_active_format: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
speaker_passive_format: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
focus_speakers: list[str] | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
ignore_speakers: list[str] | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
focus_mode: SpeakerFocusMode | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
known_speakers: list[SpeakerIdentifier] | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
additional_vocab: list[AdditionalVocabEntry] | _NotGiven = field(
|
||||
default_factory=lambda: NOT_GIVEN
|
||||
)
|
||||
audio_encoding: AudioEncoding | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
operating_point: OperatingPoint | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
max_delay: float | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
end_of_utterance_silence_trigger: float | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
end_of_utterance_max_delay: float | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
punctuation_overrides: dict[str, Any] | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
include_partials: bool | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
split_sentences: bool | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
enable_diarization: bool | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
speaker_sensitivity: float | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
max_speakers: int | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
prefer_current_speaker: bool | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
extra_params: dict[str, Any] | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
#: Fields that can be updated on a live connection via the Speechmatics
|
||||
#: diarization-config API — no reconnect needed.
|
||||
|
||||
@@ -56,7 +56,7 @@ from pipecat.processors.aggregators.openai_llm_context import (
|
||||
)
|
||||
from pipecat.processors.frame_processor import FrameDirection
|
||||
from pipecat.services.llm_service import FunctionCallFromLLM, LLMService
|
||||
from pipecat.services.settings import NOT_GIVEN, LLMSettings
|
||||
from pipecat.services.settings import NOT_GIVEN, LLMSettings, _NotGiven
|
||||
from pipecat.utils.time import time_now_iso8601
|
||||
|
||||
try:
|
||||
@@ -75,7 +75,7 @@ class UltravoxRealtimeLLMSettings(LLMSettings):
|
||||
output_medium: The output medium for the model ("voice" or "text").
|
||||
"""
|
||||
|
||||
output_medium: str = field(default=NOT_GIVEN)
|
||||
output_medium: str | _NotGiven = field(default=NOT_GIVEN)
|
||||
|
||||
|
||||
class AgentInputParams(BaseModel):
|
||||
|
||||
@@ -18,7 +18,7 @@ from openai import AsyncOpenAI
|
||||
from openai.types.audio import Transcription
|
||||
|
||||
from pipecat.frames.frames import ErrorFrame, Frame, TranscriptionFrame
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings, _NotGiven
|
||||
from pipecat.services.stt_latency import WHISPER_TTFS_P99
|
||||
from pipecat.services.stt_service import SegmentedSTTService
|
||||
from pipecat.transcriptions.language import Language, resolve_language
|
||||
@@ -37,9 +37,9 @@ class BaseWhisperSTTSettings(STTSettings):
|
||||
temperature: Sampling temperature between 0 and 1.
|
||||
"""
|
||||
|
||||
base_url: Optional[str] = field(default_factory=lambda: NOT_GIVEN)
|
||||
prompt: Optional[str] = field(default_factory=lambda: NOT_GIVEN)
|
||||
temperature: Optional[float] = field(default_factory=lambda: NOT_GIVEN)
|
||||
base_url: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
prompt: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
temperature: float | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
def language_to_whisper_language(language: Language) -> Optional[str]:
|
||||
|
||||
@@ -20,7 +20,7 @@ from loguru import logger
|
||||
from typing_extensions import TYPE_CHECKING, override
|
||||
|
||||
from pipecat.frames.frames import ErrorFrame, Frame, TranscriptionFrame
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings
|
||||
from pipecat.services.settings import NOT_GIVEN, STTSettings, _NotGiven
|
||||
from pipecat.services.stt_service import SegmentedSTTService
|
||||
from pipecat.transcriptions.language import Language, resolve_language
|
||||
from pipecat.utils.time import time_now_iso8601
|
||||
@@ -184,9 +184,9 @@ class WhisperSTTSettings(STTSettings):
|
||||
no_speech_prob: Probability threshold for filtering non-speech segments.
|
||||
"""
|
||||
|
||||
device: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
compute_type: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
no_speech_prob: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
device: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
compute_type: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
no_speech_prob: float | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -199,9 +199,9 @@ class WhisperMLXSTTSettings(STTSettings):
|
||||
engine: Whisper engine identifier.
|
||||
"""
|
||||
|
||||
no_speech_prob: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
temperature: float = field(default_factory=lambda: NOT_GIVEN)
|
||||
engine: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
no_speech_prob: float | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
temperature: float | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
engine: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
class WhisperSTTService(SegmentedSTTService):
|
||||
|
||||
@@ -25,7 +25,7 @@ from pipecat.frames.frames import (
|
||||
TTSStartedFrame,
|
||||
TTSStoppedFrame,
|
||||
)
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings
|
||||
from pipecat.services.settings import NOT_GIVEN, TTSSettings, _NotGiven
|
||||
from pipecat.services.tts_service import TTSService
|
||||
from pipecat.transcriptions.language import Language, resolve_language
|
||||
from pipecat.utils.tracing.service_decorators import traced_tts
|
||||
@@ -78,7 +78,7 @@ class XTTSTTSSettings(TTSSettings):
|
||||
base_url: Base URL of the XTTS streaming server.
|
||||
"""
|
||||
|
||||
base_url: str = field(default_factory=lambda: NOT_GIVEN)
|
||||
base_url: str | _NotGiven = field(default_factory=lambda: NOT_GIVEN)
|
||||
|
||||
|
||||
class XTTSService(TTSService):
|
||||
|
||||
Reference in New Issue
Block a user