From 10a32c943fb6e45297fc12967c7028637f2839ca Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Wed, 10 Dec 2025 07:27:10 -0500 Subject: [PATCH] deprecate: FalSmartTurnAnalyzer and LocalSmartTurnAnalyzer --- changelog/3219.deprecated.md | 1 + .../audio/turn/smart_turn/fal_smart_turn.py | 14 ++++++++++++++ .../audio/turn/smart_turn/local_smart_turn.py | 14 ++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 changelog/3219.deprecated.md diff --git a/changelog/3219.deprecated.md b/changelog/3219.deprecated.md new file mode 100644 index 000000000..65dc3aa17 --- /dev/null +++ b/changelog/3219.deprecated.md @@ -0,0 +1 @@ +- `FalSmartTurnAnalyzer` and `LocalSmartTurnAnalyzer` are deprecated and will be removed in a future version. Use `LocalSmartTurnAnalyzerV3` instead. diff --git a/src/pipecat/audio/turn/smart_turn/fal_smart_turn.py b/src/pipecat/audio/turn/smart_turn/fal_smart_turn.py index d627eca72..ea7a1d8d0 100644 --- a/src/pipecat/audio/turn/smart_turn/fal_smart_turn.py +++ b/src/pipecat/audio/turn/smart_turn/fal_smart_turn.py @@ -14,6 +14,7 @@ Note: To learn more about the smart-turn model, visit: - https://github.com/pipecat-ai/smart-turn """ +import warnings from typing import Optional import aiohttp @@ -26,6 +27,10 @@ class FalSmartTurnAnalyzer(HttpSmartTurnAnalyzer): Extends HttpSmartTurnAnalyzer to provide integration with Fal.ai's smart turn detection API endpoint with proper authentication. + + .. deprecated:: 0.98.0 + FalSmartTurnAnalyzer is deprecated and will be removed in a future version. + Use LocalSmartTurnAnalyzerV3 instead. """ def __init__( @@ -48,3 +53,12 @@ class FalSmartTurnAnalyzer(HttpSmartTurnAnalyzer): if api_key: headers = {"Authorization": f"Key {api_key}"} super().__init__(url=url, aiohttp_session=aiohttp_session, headers=headers, **kwargs) + + with warnings.catch_warnings(): + warnings.simplefilter("always") + warnings.warn( + "FalSmartTurnAnalyzer is deprecated and will be removed in a future version. " + "Use LocalSmartTurnAnalyzerV3 instead.", + DeprecationWarning, + stacklevel=2, + ) 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 e52994f1d..07200a13d 100644 --- a/src/pipecat/audio/turn/smart_turn/local_smart_turn.py +++ b/src/pipecat/audio/turn/smart_turn/local_smart_turn.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 @@ -34,6 +35,10 @@ class LocalSmartTurnAnalyzer(BaseSmartTurn): Provides end-of-turn detection using locally-stored PyTorch models, enabling offline operation without network dependencies. Uses Wav2Vec2-BERT architecture for audio sequence classification. + + .. deprecated:: 0.98.0 + LocalSmartTurnAnalyzer is deprecated and will be removed in a future version. + Use LocalSmartTurnAnalyzerV3 instead. """ def __init__(self, *, smart_turn_model_path: str, **kwargs): @@ -46,6 +51,15 @@ class LocalSmartTurnAnalyzer(BaseSmartTurn): """ super().__init__(**kwargs) + with warnings.catch_warnings(): + warnings.simplefilter("always") + warnings.warn( + "LocalSmartTurnAnalyzer 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"