Deprecate support for vad_events in DeepgramSTTService
This commit is contained in:
1
changelog/3386.deprecated.md
Normal file
1
changelog/3386.deprecated.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
- Deprecated support for the `vad_events` `LiveOptions` in `DeepgramSTTService`. Instead, use a local Silero VAD for VAD events. Additionally, deprecated `should_interrupt` which will be removed along with `vad_events` support in a future release.
|
||||||
@@ -105,7 +105,6 @@ TESTS_07 = [
|
|||||||
("07c-interruptible-deepgram.py", EVAL_SIMPLE_MATH),
|
("07c-interruptible-deepgram.py", EVAL_SIMPLE_MATH),
|
||||||
("07c-interruptible-deepgram-flux.py", EVAL_SIMPLE_MATH),
|
("07c-interruptible-deepgram-flux.py", EVAL_SIMPLE_MATH),
|
||||||
("07c-interruptible-deepgram-http.py", EVAL_SIMPLE_MATH),
|
("07c-interruptible-deepgram-http.py", EVAL_SIMPLE_MATH),
|
||||||
("07c-interruptible-deepgram-vad.py", EVAL_SIMPLE_MATH),
|
|
||||||
("07d-interruptible-elevenlabs.py", EVAL_SIMPLE_MATH),
|
("07d-interruptible-elevenlabs.py", EVAL_SIMPLE_MATH),
|
||||||
("07d-interruptible-elevenlabs-http.py", EVAL_SIMPLE_MATH),
|
("07d-interruptible-elevenlabs-http.py", EVAL_SIMPLE_MATH),
|
||||||
("07f-interruptible-azure.py", EVAL_SIMPLE_MATH),
|
("07f-interruptible-azure.py", EVAL_SIMPLE_MATH),
|
||||||
|
|||||||
@@ -48,8 +48,7 @@ class DeepgramSTTService(STTService):
|
|||||||
"""Deepgram speech-to-text service.
|
"""Deepgram speech-to-text service.
|
||||||
|
|
||||||
Provides real-time speech recognition using Deepgram's WebSocket API.
|
Provides real-time speech recognition using Deepgram's WebSocket API.
|
||||||
Supports configurable models, languages, VAD events, and various audio
|
Supports configurable models, languages, and various audio processing options.
|
||||||
processing options.
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
@@ -78,7 +77,14 @@ class DeepgramSTTService(STTService):
|
|||||||
live_options: Deepgram LiveOptions for detailed configuration.
|
live_options: Deepgram LiveOptions for detailed configuration.
|
||||||
addons: Additional Deepgram features to enable.
|
addons: Additional Deepgram features to enable.
|
||||||
should_interrupt: Determine whether the bot should be interrupted when Deepgram VAD events are enabled and the system detects that the user is speaking.
|
should_interrupt: Determine whether the bot should be interrupted when Deepgram VAD events are enabled and the system detects that the user is speaking.
|
||||||
|
|
||||||
|
.. deprecated:: 0.0.99
|
||||||
|
This parameter will be removed along with `vad_events` support.
|
||||||
|
|
||||||
**kwargs: Additional arguments passed to the parent STTService.
|
**kwargs: Additional arguments passed to the parent STTService.
|
||||||
|
|
||||||
|
Note:
|
||||||
|
The `vad_events` option in LiveOptions is deprecated as of version 0.0.99 and will be removed in a future version. Please use the Silero VAD instead.
|
||||||
"""
|
"""
|
||||||
sample_rate = sample_rate or (live_options.sample_rate if live_options else None)
|
sample_rate = sample_rate or (live_options.sample_rate if live_options else None)
|
||||||
super().__init__(sample_rate=sample_rate, **kwargs)
|
super().__init__(sample_rate=sample_rate, **kwargs)
|
||||||
@@ -123,6 +129,18 @@ class DeepgramSTTService(STTService):
|
|||||||
self._addons = addons
|
self._addons = addons
|
||||||
self._should_interrupt = should_interrupt
|
self._should_interrupt = should_interrupt
|
||||||
|
|
||||||
|
if merged_options.get("vad_events"):
|
||||||
|
import warnings
|
||||||
|
|
||||||
|
with warnings.catch_warnings():
|
||||||
|
warnings.simplefilter("always")
|
||||||
|
warnings.warn(
|
||||||
|
"The 'vad_events' parameter is deprecated and will be removed in a future version. "
|
||||||
|
"Please use the Silero VAD instead.",
|
||||||
|
DeprecationWarning,
|
||||||
|
stacklevel=2,
|
||||||
|
)
|
||||||
|
|
||||||
self._client = DeepgramClient(
|
self._client = DeepgramClient(
|
||||||
api_key,
|
api_key,
|
||||||
config=DeepgramClientOptions(
|
config=DeepgramClientOptions(
|
||||||
|
|||||||
Reference in New Issue
Block a user