Merge pull request #3386 from pipecat-ai/mb/deepgram-deprecate-vad-events

Deprecate support for vad_events in DeepgramSTTService
This commit is contained in:
Mark Backman
2026-01-09 07:56:03 -05:00
committed by GitHub
3 changed files with 21 additions and 3 deletions

View 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.

View File

@@ -105,7 +105,6 @@ TESTS_07 = [
("07c-interruptible-deepgram.py", EVAL_SIMPLE_MATH),
("07c-interruptible-deepgram-flux.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-http.py", EVAL_SIMPLE_MATH),
("07f-interruptible-azure.py", EVAL_SIMPLE_MATH),

View File

@@ -48,8 +48,7 @@ class DeepgramSTTService(STTService):
"""Deepgram speech-to-text service.
Provides real-time speech recognition using Deepgram's WebSocket API.
Supports configurable models, languages, VAD events, and various audio
processing options.
Supports configurable models, languages, and various audio processing options.
"""
def __init__(
@@ -78,7 +77,14 @@ class DeepgramSTTService(STTService):
live_options: Deepgram LiveOptions for detailed configuration.
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.
.. deprecated:: 0.0.99
This parameter will be removed along with `vad_events` support.
**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)
super().__init__(sample_rate=sample_rate, **kwargs)
@@ -123,6 +129,18 @@ class DeepgramSTTService(STTService):
self._addons = addons
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(
api_key,
config=DeepgramClientOptions(