protobuf
Protobuf frame serialization for Pipecat.
- class pipecat.serializers.protobuf.MessageFrame(data: str)[source]
Bases:
objectData class for converting transport messages into Protobuf format.
- Parameters:
data – JSON-encoded message data for transport.
- data: str
- class pipecat.serializers.protobuf.ProtobufFrameSerializer(params: InputParams | None = None)[source]
Bases:
FrameSerializerSerializer for converting Pipecat frames to/from Protocol Buffer format.
Provides efficient binary serialization for frame transport over network connections. Supports text, audio, transcription, and message frames with automatic conversion between transport message types.
- SERIALIZABLE_TYPES = {<class 'pipecat.frames.frames.OutputAudioRawFrame'>: 'audio', <class 'pipecat.frames.frames.TextFrame'>: 'text', <class 'pipecat.frames.frames.TranscriptionFrame'>: 'transcription', <class 'pipecat.serializers.protobuf.MessageFrame'>: 'message'}
- SERIALIZABLE_FIELDS = {'audio': <class 'pipecat.frames.frames.OutputAudioRawFrame'>, 'message': <class 'pipecat.serializers.protobuf.MessageFrame'>, 'text': <class 'pipecat.frames.frames.TextFrame'>, 'transcription': <class 'pipecat.frames.frames.TranscriptionFrame'>}
- DESERIALIZABLE_TYPES = {<class 'pipecat.frames.frames.InputAudioRawFrame'>: 'audio', <class 'pipecat.frames.frames.TextFrame'>: 'text', <class 'pipecat.frames.frames.TranscriptionFrame'>: 'transcription', <class 'pipecat.serializers.protobuf.MessageFrame'>: 'message'}
- DESERIALIZABLE_FIELDS = {'audio': <class 'pipecat.frames.frames.InputAudioRawFrame'>, 'message': <class 'pipecat.serializers.protobuf.MessageFrame'>, 'text': <class 'pipecat.frames.frames.TextFrame'>, 'transcription': <class 'pipecat.frames.frames.TranscriptionFrame'>}
- __init__(params: InputParams | None = None)[source]
Initialize the Protobuf frame serializer.
- Parameters:
params – Configuration parameters.