From de38ca626d6b11d6d11c90e88145fc8d23133da0 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Thu, 12 Mar 2026 17:19:32 -0400 Subject: [PATCH 1/2] Deprecate LocalSmartTurnAnalyzerV2 and LocalCoreMLSmartTurnAnalyzer Both analyzers are superseded by LocalSmartTurnAnalyzerV3. Added deprecation warnings and docstring notices following the existing pattern from LocalSmartTurnAnalyzer. --- .../turn/smart_turn/local_coreml_smart_turn.py | 14 ++++++++++++++ .../audio/turn/smart_turn/local_smart_turn.py | 2 +- .../audio/turn/smart_turn/local_smart_turn_v2.py | 14 ++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/pipecat/audio/turn/smart_turn/local_coreml_smart_turn.py b/src/pipecat/audio/turn/smart_turn/local_coreml_smart_turn.py index be4744c27..18310c386 100644 --- a/src/pipecat/audio/turn/smart_turn/local_coreml_smart_turn.py +++ b/src/pipecat/audio/turn/smart_turn/local_coreml_smart_turn.py @@ -10,6 +10,7 @@ This module provides a smart turn analyzer that uses CoreML models for local end-of-turn detection without requiring network connectivity. """ +import warnings from typing import Any, Dict import numpy as np @@ -35,6 +36,10 @@ class LocalCoreMLSmartTurnAnalyzer(BaseSmartTurn): Provides end-of-turn detection using locally-stored CoreML models, enabling offline operation without network dependencies. Optimized for Apple Silicon and other CoreML-compatible hardware. + + .. deprecated:: 0.0.106 + LocalCoreMLSmartTurnAnalyzer is deprecated and will be removed in a future version. + Use LocalSmartTurnAnalyzerV3 instead. """ def __init__(self, *, smart_turn_model_path: str, **kwargs): @@ -50,6 +55,15 @@ class LocalCoreMLSmartTurnAnalyzer(BaseSmartTurn): """ super().__init__(**kwargs) + with warnings.catch_warnings(): + warnings.simplefilter("always") + warnings.warn( + "LocalCoreMLSmartTurnAnalyzer is deprecated and will be removed in a future " + "version. Use LocalSmartTurnAnalyzerV3 instead.", + DeprecationWarning, + stacklevel=2, + ) + if not smart_turn_model_path: logger.error("smart_turn_model_path is not set.") raise Exception("smart_turn_model_path must be provided.") diff --git a/src/pipecat/audio/turn/smart_turn/local_smart_turn.py b/src/pipecat/audio/turn/smart_turn/local_smart_turn.py index e98c345a1..791b63af1 100644 --- a/src/pipecat/audio/turn/smart_turn/local_smart_turn.py +++ b/src/pipecat/audio/turn/smart_turn/local_smart_turn.py @@ -36,7 +36,7 @@ class LocalSmartTurnAnalyzer(BaseSmartTurn): enabling offline operation without network dependencies. Uses Wav2Vec2-BERT architecture for audio sequence classification. - .. deprecated:: 0.98.0 + .. deprecated:: 0.0.98 LocalSmartTurnAnalyzer is deprecated and will be removed in a future version. Use LocalSmartTurnAnalyzerV3 instead. """ diff --git a/src/pipecat/audio/turn/smart_turn/local_smart_turn_v2.py b/src/pipecat/audio/turn/smart_turn/local_smart_turn_v2.py index 0b2f21cba..8d584ecd2 100644 --- a/src/pipecat/audio/turn/smart_turn/local_smart_turn_v2.py +++ b/src/pipecat/audio/turn/smart_turn/local_smart_turn_v2.py @@ -10,6 +10,7 @@ This module provides a smart turn analyzer that uses PyTorch models for local end-of-turn detection without requiring network connectivity. """ +import warnings from typing import Any, Dict import numpy as np @@ -41,6 +42,10 @@ class LocalSmartTurnAnalyzerV2(BaseSmartTurn): Provides end-of-turn detection using locally-stored PyTorch models, enabling offline operation without network dependencies. Uses Wav2Vec2 architecture for audio sequence classification. + + .. deprecated:: 0.0.106 + LocalSmartTurnAnalyzerV2 is deprecated and will be removed in a future version. + Use LocalSmartTurnAnalyzerV3 instead. """ def __init__(self, *, smart_turn_model_path: str, **kwargs): @@ -53,6 +58,15 @@ class LocalSmartTurnAnalyzerV2(BaseSmartTurn): """ super().__init__(**kwargs) + with warnings.catch_warnings(): + warnings.simplefilter("always") + warnings.warn( + "LocalSmartTurnAnalyzerV2 is deprecated and will be removed in a future version. " + "Use LocalSmartTurnAnalyzerV3 instead.", + DeprecationWarning, + stacklevel=2, + ) + if not smart_turn_model_path: # Define the path to the pretrained model on Hugging Face smart_turn_model_path = "pipecat-ai/smart-turn-v2" From ed0b8dadb51dfe6a95feff693d5f8073451aa118 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Thu, 12 Mar 2026 17:22:13 -0400 Subject: [PATCH 2/2] Add changelog for #4012 --- changelog/4012.deprecated.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/4012.deprecated.md diff --git a/changelog/4012.deprecated.md b/changelog/4012.deprecated.md new file mode 100644 index 000000000..4310b8aba --- /dev/null +++ b/changelog/4012.deprecated.md @@ -0,0 +1 @@ +- Deprecated `LocalSmartTurnAnalyzerV2` and `LocalCoreMLSmartTurnAnalyzer`. Use `LocalSmartTurnAnalyzerV3` instead. Instantiating these analyzers will now emit a `DeprecationWarning`.