From 62f4708d43a4f393ff386e305ed37304ed48ab57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Wed, 21 Jan 2026 14:12:47 -0800 Subject: [PATCH] transports: broadcast InputTransportMessageFrame frames --- src/pipecat/transports/daily/transport.py | 5 +++-- src/pipecat/transports/smallwebrtc/transport.py | 3 +-- src/pipecat/transports/websocket/client.py | 3 +++ src/pipecat/transports/websocket/fastapi.py | 3 +++ src/pipecat/transports/websocket/server.py | 4 ++++ 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/pipecat/transports/daily/transport.py b/src/pipecat/transports/daily/transport.py index 3b652b517..e220ab0d8 100644 --- a/src/pipecat/transports/daily/transport.py +++ b/src/pipecat/transports/daily/transport.py @@ -1728,8 +1728,9 @@ class DailyInputTransport(BaseInputTransport): message: The message data to send. sender: ID of the message sender. """ - frame = DailyInputTransportMessageFrame(message=message, participant_id=sender) - await self.push_frame(frame) + await self.broadcast_frame_class( + DailyInputTransportMessageFrame, message=message, participant_id=sender + ) # # Audio in diff --git a/src/pipecat/transports/smallwebrtc/transport.py b/src/pipecat/transports/smallwebrtc/transport.py index e9a07cf40..bcc3c8b79 100644 --- a/src/pipecat/transports/smallwebrtc/transport.py +++ b/src/pipecat/transports/smallwebrtc/transport.py @@ -698,8 +698,7 @@ class SmallWebRTCInputTransport(BaseInputTransport): message: The application message to process. """ logger.debug(f"Received app message inside SmallWebRTCInputTransport {message}") - frame = InputTransportMessageFrame(message=message) - await self.push_frame(frame) + await self.broadcast_frame_class(InputTransportMessageFrame, message=message) # Add this method similar to DailyInputTransport.request_participant_image async def request_participant_image(self, frame: UserImageRequestFrame): diff --git a/src/pipecat/transports/websocket/client.py b/src/pipecat/transports/websocket/client.py index 02c891c54..f55b1f919 100644 --- a/src/pipecat/transports/websocket/client.py +++ b/src/pipecat/transports/websocket/client.py @@ -27,6 +27,7 @@ from pipecat.frames.frames import ( EndFrame, Frame, InputAudioRawFrame, + InputTransportMessageFrame, OutputAudioRawFrame, OutputTransportMessageFrame, OutputTransportMessageUrgentFrame, @@ -298,6 +299,8 @@ class WebsocketClientInputTransport(BaseInputTransport): return if isinstance(frame, InputAudioRawFrame) and self._params.audio_in_enabled: await self.push_audio_frame(frame) + elif isinstance(frame, InputTransportMessageFrame): + await self.broadcast_frame(frame) else: await self.push_frame(frame) diff --git a/src/pipecat/transports/websocket/fastapi.py b/src/pipecat/transports/websocket/fastapi.py index e1d02ac00..a0d02ccec 100644 --- a/src/pipecat/transports/websocket/fastapi.py +++ b/src/pipecat/transports/websocket/fastapi.py @@ -26,6 +26,7 @@ from pipecat.frames.frames import ( EndFrame, Frame, InputAudioRawFrame, + InputTransportMessageFrame, InterruptionFrame, OutputAudioRawFrame, OutputTransportMessageFrame, @@ -311,6 +312,8 @@ class FastAPIWebsocketInputTransport(BaseInputTransport): if isinstance(frame, InputAudioRawFrame): await self.push_audio_frame(frame) + elif isinstance(frame, InputTransportMessageFrame): + await self.broadcast_frame(frame) else: await self.push_frame(frame) except Exception as e: diff --git a/src/pipecat/transports/websocket/server.py b/src/pipecat/transports/websocket/server.py index a31ac5487..acd4faf92 100644 --- a/src/pipecat/transports/websocket/server.py +++ b/src/pipecat/transports/websocket/server.py @@ -25,6 +25,8 @@ from pipecat.frames.frames import ( EndFrame, Frame, InputAudioRawFrame, + InputTransportMessageFrame, + InputTransportMessageUrgentFrame, InterruptionFrame, OutputAudioRawFrame, OutputTransportMessageFrame, @@ -214,6 +216,8 @@ class WebsocketServerInputTransport(BaseInputTransport): if isinstance(frame, InputAudioRawFrame): await self.push_audio_frame(frame) + elif isinstance(frame, InputTransportMessageFrame): + await self.broadcast_frame(frame) else: await self.push_frame(frame) except Exception as e: