frames: remove deprecated KeypadEntryFrame
This commit is contained in:
@@ -28,7 +28,7 @@ from typing import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
from pipecat.adapters.schemas.tools_schema import ToolsSchema
|
from pipecat.adapters.schemas.tools_schema import ToolsSchema
|
||||||
from pipecat.audio.dtmf.types import KeypadEntry as NewKeypadEntry
|
from pipecat.audio.dtmf.types import KeypadEntry
|
||||||
from pipecat.audio.interruptions.base_interruption_strategy import BaseInterruptionStrategy
|
from pipecat.audio.interruptions.base_interruption_strategy import BaseInterruptionStrategy
|
||||||
from pipecat.audio.turn.base_turn_analyzer import BaseTurnParams
|
from pipecat.audio.turn.base_turn_analyzer import BaseTurnParams
|
||||||
from pipecat.audio.vad.vad_analyzer import VADParams
|
from pipecat.audio.vad.vad_analyzer import VADParams
|
||||||
@@ -46,62 +46,6 @@ if TYPE_CHECKING:
|
|||||||
from pipecat.utils.tracing.tracing_context import TracingContext
|
from pipecat.utils.tracing.tracing_context import TracingContext
|
||||||
|
|
||||||
|
|
||||||
class DeprecatedKeypadEntry:
|
|
||||||
"""DTMF keypad entries for phone system integration.
|
|
||||||
|
|
||||||
.. deprecated:: 0.0.82
|
|
||||||
This class is deprecated and will be removed in a future version.
|
|
||||||
Instead, use `audio.dtmf.types.KeypadEntry`.
|
|
||||||
|
|
||||||
Parameters:
|
|
||||||
ONE: Number key 1.
|
|
||||||
TWO: Number key 2.
|
|
||||||
THREE: Number key 3.
|
|
||||||
FOUR: Number key 4.
|
|
||||||
FIVE: Number key 5.
|
|
||||||
SIX: Number key 6.
|
|
||||||
SEVEN: Number key 7.
|
|
||||||
EIGHT: Number key 8.
|
|
||||||
NINE: Number key 9.
|
|
||||||
ZERO: Number key 0.
|
|
||||||
POUND: Pound/hash key (#).
|
|
||||||
STAR: Star/asterisk key (*).
|
|
||||||
"""
|
|
||||||
|
|
||||||
_enum = NewKeypadEntry
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def _warn(cls):
|
|
||||||
import warnings
|
|
||||||
|
|
||||||
with warnings.catch_warnings():
|
|
||||||
warnings.simplefilter("always")
|
|
||||||
warnings.warn(
|
|
||||||
"`pipecat.frames.frames.KeypadEntry` is deprecated and will be removed in a future version. "
|
|
||||||
"Use `pipecat.audio.dtmf.types.KeypadEntry` instead.",
|
|
||||||
DeprecationWarning,
|
|
||||||
stacklevel=2,
|
|
||||||
)
|
|
||||||
|
|
||||||
def __call__(self, *args: Any, **kwargs: Any) -> Any:
|
|
||||||
"""Allow the instance to be called as a function."""
|
|
||||||
self._warn()
|
|
||||||
return self._enum(*args, **kwargs)
|
|
||||||
|
|
||||||
def __getattr__(self, name):
|
|
||||||
"""Retrieve an attribute from the underlying enum."""
|
|
||||||
self._warn()
|
|
||||||
return getattr(self._enum, name)
|
|
||||||
|
|
||||||
def __getitem__(self, name):
|
|
||||||
"""Retrieve an item from the underlying enum."""
|
|
||||||
self._warn()
|
|
||||||
return self._enum[name]
|
|
||||||
|
|
||||||
|
|
||||||
KeypadEntry = DeprecatedKeypadEntry()
|
|
||||||
|
|
||||||
|
|
||||||
def format_pts(pts: Optional[int]):
|
def format_pts(pts: Optional[int]):
|
||||||
"""Format presentation timestamp (PTS) in nanoseconds to a human-readable string.
|
"""Format presentation timestamp (PTS) in nanoseconds to a human-readable string.
|
||||||
|
|
||||||
@@ -997,7 +941,7 @@ class DTMFFrame:
|
|||||||
button: The DTMF keypad entry that was pressed.
|
button: The DTMF keypad entry that was pressed.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
button: NewKeypadEntry
|
button: KeypadEntry
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
|||||||
Reference in New Issue
Block a user