From dceec6018658ee379e0fbdc0e78daa84ff911a61 Mon Sep 17 00:00:00 2001 From: Filipi Fuchter Date: Thu, 13 Feb 2025 18:07:33 -0300 Subject: [PATCH] Updated `FastAPIWebsocketOutputTransport` to send `TransportMessageFrame` and `TransportMessageUrgentFrame` to the serializer. --- src/pipecat/transports/network/fastapi_websocket.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pipecat/transports/network/fastapi_websocket.py b/src/pipecat/transports/network/fastapi_websocket.py index 8da8396ff..9c4c170f2 100644 --- a/src/pipecat/transports/network/fastapi_websocket.py +++ b/src/pipecat/transports/network/fastapi_websocket.py @@ -23,6 +23,8 @@ from pipecat.frames.frames import ( OutputAudioRawFrame, StartFrame, StartInterruptionFrame, + TransportMessageFrame, + TransportMessageUrgentFrame, ) from pipecat.processors.frame_processor import FrameDirection from pipecat.serializers.base_serializer import FrameSerializer, FrameSerializerType @@ -139,6 +141,9 @@ class FastAPIWebsocketOutputTransport(BaseOutputTransport): await self._write_frame(frame) self._next_send_time = 0 + async def send_message(self, frame: TransportMessageFrame | TransportMessageUrgentFrame): + await self._write_frame(frame) + async def write_raw_audio_frames(self, frames: bytes): if self._websocket.client_state != WebSocketState.CONNECTED: # Simulate audio playback with a sleep.