Merge pull request #2826 from pipecat-ai/mb/deprecate-livekit-frame-serializer

Deprecate LivekitFrameSerializer
This commit is contained in:
Mark Backman
2025-10-10 10:01:45 -04:00
committed by GitHub
2 changed files with 22 additions and 0 deletions

View File

@@ -47,6 +47,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Deprecated ### Deprecated
- `LivekitFrameSerializer` is now deprecated. Use `LiveKitTransport` instead.
- `pipecat.service.openai_realtime` is now deprecated, use - `pipecat.service.openai_realtime` is now deprecated, use
`pipecat.services.openai.realtime` instead or `pipecat.services.openai.realtime` instead or
`pipecat.services.azure.realtime` for Azure Realtime. `pipecat.services.azure.realtime` for Azure Realtime.

View File

@@ -25,11 +25,31 @@ except ModuleNotFoundError as e:
class LivekitFrameSerializer(FrameSerializer): class LivekitFrameSerializer(FrameSerializer):
"""Serializer for converting between Pipecat frames and LiveKit audio frames. """Serializer for converting between Pipecat frames and LiveKit audio frames.
.. deprecated:: 0.0.90
This class is deprecated and will be removed in a future version.
Please use LiveKitTransport instead, which handles audio streaming
and frame conversion natively.
This serializer handles the conversion of Pipecat's OutputAudioRawFrame objects This serializer handles the conversion of Pipecat's OutputAudioRawFrame objects
to LiveKit AudioFrame objects for transmission, and the reverse conversion to LiveKit AudioFrame objects for transmission, and the reverse conversion
for received audio data. for received audio data.
""" """
def __init__(self):
"""Initialize the LiveKit frame serializer."""
super().__init__()
import warnings
with warnings.catch_warnings():
warnings.simplefilter("always")
warnings.warn(
"LivekitFrameSerializer is deprecated and will be removed in a future version. "
"Please use LiveKitTransport instead, which handles audio streaming natively.",
DeprecationWarning,
stacklevel=2,
)
@property @property
def type(self) -> FrameSerializerType: def type(self) -> FrameSerializerType:
"""Get the serializer type. """Get the serializer type.