diff --git a/src/pipecat/serializers/base_serializer.py b/src/pipecat/serializers/base_serializer.py index 823d00c7b..490951a69 100644 --- a/src/pipecat/serializers/base_serializer.py +++ b/src/pipecat/serializers/base_serializer.py @@ -7,41 +7,18 @@ """Frame serialization interfaces for Pipecat.""" from abc import ABC, abstractmethod -from enum import Enum from pipecat.frames.frames import Frame, StartFrame -class FrameSerializerType(Enum): - """Enumeration of supported frame serialization formats. - - Parameters: - BINARY: Binary serialization format for compact representation. - TEXT: Text-based serialization format for human-readable output. - """ - - BINARY = "binary" - TEXT = "text" - - class FrameSerializer(ABC): """Abstract base class for frame serialization implementations. Defines the interface for converting frames to/from serialized formats - for transmission or storage. Subclasses must implement serialization - type detection and the core serialize/deserialize methods. + for transmission or storage. Subclasses must implement the core + serialize/deserialize methods. """ - @property - @abstractmethod - def type(self) -> FrameSerializerType: - """Get the serialization type supported by this serializer. - - Returns: - The FrameSerializerType indicating binary or text format. - """ - pass - async def setup(self, frame: StartFrame): """Initialize the serializer with startup configuration. diff --git a/src/pipecat/serializers/exotel.py b/src/pipecat/serializers/exotel.py index f9c2b2e5f..61d6eeada 100644 --- a/src/pipecat/serializers/exotel.py +++ b/src/pipecat/serializers/exotel.py @@ -25,7 +25,7 @@ from pipecat.frames.frames import ( OutputTransportMessageUrgentFrame, StartFrame, ) -from pipecat.serializers.base_serializer import FrameSerializer, FrameSerializerType +from pipecat.serializers.base_serializer import FrameSerializer class ExotelFrameSerializer(FrameSerializer): @@ -70,15 +70,6 @@ class ExotelFrameSerializer(FrameSerializer): self._input_resampler = create_stream_resampler() self._output_resampler = create_stream_resampler() - @property - def type(self) -> FrameSerializerType: - """Gets the serializer type. - - Returns: - The serializer type, either TEXT or BINARY. - """ - return FrameSerializerType.TEXT - async def setup(self, frame: StartFrame): """Sets up the serializer with pipeline configuration. diff --git a/src/pipecat/serializers/plivo.py b/src/pipecat/serializers/plivo.py index d54f86fe9..2a57d3698 100644 --- a/src/pipecat/serializers/plivo.py +++ b/src/pipecat/serializers/plivo.py @@ -27,7 +27,7 @@ from pipecat.frames.frames import ( OutputTransportMessageUrgentFrame, StartFrame, ) -from pipecat.serializers.base_serializer import FrameSerializer, FrameSerializerType +from pipecat.serializers.base_serializer import FrameSerializer class PlivoFrameSerializer(FrameSerializer): @@ -85,15 +85,6 @@ class PlivoFrameSerializer(FrameSerializer): self._output_resampler = create_stream_resampler() self._hangup_attempted = False - @property - def type(self) -> FrameSerializerType: - """Gets the serializer type. - - Returns: - The serializer type, either TEXT or BINARY. - """ - return FrameSerializerType.TEXT - async def setup(self, frame: StartFrame): """Sets up the serializer with pipeline configuration. diff --git a/src/pipecat/serializers/protobuf.py b/src/pipecat/serializers/protobuf.py index f079a1f72..6d989c7dd 100644 --- a/src/pipecat/serializers/protobuf.py +++ b/src/pipecat/serializers/protobuf.py @@ -22,7 +22,7 @@ from pipecat.frames.frames import ( TextFrame, TranscriptionFrame, ) -from pipecat.serializers.base_serializer import FrameSerializer, FrameSerializerType +from pipecat.serializers.base_serializer import FrameSerializer @dataclasses.dataclass @@ -64,15 +64,6 @@ class ProtobufFrameSerializer(FrameSerializer): """Initialize the Protobuf frame serializer.""" pass - @property - def type(self) -> FrameSerializerType: - """Get the serializer type. - - Returns: - FrameSerializerType.BINARY indicating binary serialization format. - """ - return FrameSerializerType.BINARY - async def serialize(self, frame: Frame) -> str | bytes | None: """Serialize a frame to Protocol Buffer binary format. diff --git a/src/pipecat/serializers/telnyx.py b/src/pipecat/serializers/telnyx.py index a9e837f06..769244f93 100644 --- a/src/pipecat/serializers/telnyx.py +++ b/src/pipecat/serializers/telnyx.py @@ -32,7 +32,7 @@ from pipecat.frames.frames import ( InterruptionFrame, StartFrame, ) -from pipecat.serializers.base_serializer import FrameSerializer, FrameSerializerType +from pipecat.serializers.base_serializer import FrameSerializer class TelnyxFrameSerializer(FrameSerializer): @@ -97,15 +97,6 @@ class TelnyxFrameSerializer(FrameSerializer): self._output_resampler = create_stream_resampler() self._hangup_attempted = False - @property - def type(self) -> FrameSerializerType: - """Gets the serializer type. - - Returns: - The serializer type, either TEXT or BINARY. - """ - return FrameSerializerType.TEXT - async def setup(self, frame: StartFrame): """Sets up the serializer with pipeline configuration. diff --git a/src/pipecat/serializers/twilio.py b/src/pipecat/serializers/twilio.py index c9569044c..2e60399fd 100644 --- a/src/pipecat/serializers/twilio.py +++ b/src/pipecat/serializers/twilio.py @@ -27,7 +27,7 @@ from pipecat.frames.frames import ( OutputTransportMessageUrgentFrame, StartFrame, ) -from pipecat.serializers.base_serializer import FrameSerializer, FrameSerializerType +from pipecat.serializers.base_serializer import FrameSerializer class TwilioFrameSerializer(FrameSerializer): @@ -116,15 +116,6 @@ class TwilioFrameSerializer(FrameSerializer): self._output_resampler = create_stream_resampler() self._hangup_attempted = False - @property - def type(self) -> FrameSerializerType: - """Gets the serializer type. - - Returns: - The serializer type, either TEXT or BINARY. - """ - return FrameSerializerType.TEXT - async def setup(self, frame: StartFrame): """Sets up the serializer with pipeline configuration.