From 7a6ba277455d76d32e70e1a3076bbebd057aaedd Mon Sep 17 00:00:00 2001 From: Yakov N Date: Wed, 12 Jun 2024 11:31:29 -0400 Subject: [PATCH 1/3] Adding `utterance_end_ms` and `deepgram_endpoint_ms` to transcriber configs --- vocode/streaming/models/transcriber.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vocode/streaming/models/transcriber.py b/vocode/streaming/models/transcriber.py index 2835e1fdb6..415f96ffeb 100644 --- a/vocode/streaming/models/transcriber.py +++ b/vocode/streaming/models/transcriber.py @@ -64,6 +64,8 @@ class TranscriberConfig(TypedModel, type=TranscriberType.BASE.value): input_device_config: Optional[InputDeviceConfig] = None vad: bool = False experimental: bool = False + utterance_end_ms: float = None + deepgram_endpoint_ms: float = None @validator("min_interrupt_confidence") def min_interrupt_confidence_must_be_between_0_and_1(cls, v): @@ -78,6 +80,8 @@ def from_input_device_config_experimental( endpointing_config: Optional[EndpointingConfig] = None, vad: Optional[bool] = False, experimental: Optional[bool] = False, + utterance_end_ms: Optional[float] = None, + deepgram_endpoint_ms: Optional[float] = None, **kwargs, ): return cls( @@ -87,6 +91,8 @@ def from_input_device_config_experimental( endpointing_config=endpointing_config, vad=vad, experimental=experimental, + utterance_end_ms=utterance_end_ms, + deepgram_endpoint_ms=deepgram_endpoint_ms, input_device_config=InputDeviceConfig( sampling_rate=input_device.sampling_rate, audio_encoding=input_device.audio_encoding From 0e70869d32cfa273bd187bf4de275cc0622bd6a0 Mon Sep 17 00:00:00 2001 From: Yakov N Date: Wed, 12 Jun 2024 12:45:03 -0400 Subject: [PATCH 2/3] adding same new properties to other from_input_* functions --- vocode/streaming/models/transcriber.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vocode/streaming/models/transcriber.py b/vocode/streaming/models/transcriber.py index 415f96ffeb..59d30b29ea 100644 --- a/vocode/streaming/models/transcriber.py +++ b/vocode/streaming/models/transcriber.py @@ -105,6 +105,8 @@ def from_input_device_config_vad( cls, input_device: BaseInputDevice, endpointing_config: Optional[EndpointingConfig] = None, + utterance_end_ms: Optional[float] = None, + deepgram_endpoint_ms: Optional[float] = None, **kwargs, ): return cls( @@ -113,6 +115,8 @@ def from_input_device_config_vad( chunk_size=input_device.chunk_size, endpointing_config=endpointing_config, vad=True, + utterance_end_ms=utterance_end_ms, + deepgram_endpoint_ms=deepgram_endpoint_ms, # this is used for mapping the input device to the transcriber input_device_config=InputDeviceConfig( sampling_rate=input_device.sampling_rate, @@ -126,6 +130,8 @@ def from_input_device( cls, input_device: BaseInputDevice, endpointing_config: Optional[EndpointingConfig] = None, + utterance_end_ms: Optional[float] = None, + deepgram_endpoint_ms: Optional[float] = None, **kwargs, ): return cls( @@ -133,6 +139,8 @@ def from_input_device( audio_encoding=input_device.audio_encoding, chunk_size=input_device.chunk_size, endpointing_config=endpointing_config, + utterance_end_ms=utterance_end_ms, + deepgram_endpoint_ms=deepgram_endpoint_ms, **kwargs, ) From ba5d6c922378129f0949f350a033638b44befa02 Mon Sep 17 00:00:00 2001 From: Yakov N Date: Wed, 12 Jun 2024 16:55:02 -0400 Subject: [PATCH 3/3] changing fields to int from float --- vocode/streaming/models/transcriber.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vocode/streaming/models/transcriber.py b/vocode/streaming/models/transcriber.py index 59d30b29ea..9085ebeb1b 100644 --- a/vocode/streaming/models/transcriber.py +++ b/vocode/streaming/models/transcriber.py @@ -64,8 +64,8 @@ class TranscriberConfig(TypedModel, type=TranscriberType.BASE.value): input_device_config: Optional[InputDeviceConfig] = None vad: bool = False experimental: bool = False - utterance_end_ms: float = None - deepgram_endpoint_ms: float = None + utterance_end_ms: int = None + deepgram_endpoint_ms: int = None @validator("min_interrupt_confidence") def min_interrupt_confidence_must_be_between_0_and_1(cls, v):