transports: broadcast InputTransportMessageFrame frames

This commit is contained in:
Aleix Conchillo Flaqué
2026-01-21 14:12:47 -08:00
parent ba0ddb1832
commit 62f4708d43
5 changed files with 14 additions and 4 deletions

View File

@@ -1728,8 +1728,9 @@ class DailyInputTransport(BaseInputTransport):
message: The message data to send. message: The message data to send.
sender: ID of the message sender. sender: ID of the message sender.
""" """
frame = DailyInputTransportMessageFrame(message=message, participant_id=sender) await self.broadcast_frame_class(
await self.push_frame(frame) DailyInputTransportMessageFrame, message=message, participant_id=sender
)
# #
# Audio in # Audio in

View File

@@ -698,8 +698,7 @@ class SmallWebRTCInputTransport(BaseInputTransport):
message: The application message to process. message: The application message to process.
""" """
logger.debug(f"Received app message inside SmallWebRTCInputTransport {message}") logger.debug(f"Received app message inside SmallWebRTCInputTransport {message}")
frame = InputTransportMessageFrame(message=message) await self.broadcast_frame_class(InputTransportMessageFrame, message=message)
await self.push_frame(frame)
# Add this method similar to DailyInputTransport.request_participant_image # Add this method similar to DailyInputTransport.request_participant_image
async def request_participant_image(self, frame: UserImageRequestFrame): async def request_participant_image(self, frame: UserImageRequestFrame):

View File

@@ -27,6 +27,7 @@ from pipecat.frames.frames import (
EndFrame, EndFrame,
Frame, Frame,
InputAudioRawFrame, InputAudioRawFrame,
InputTransportMessageFrame,
OutputAudioRawFrame, OutputAudioRawFrame,
OutputTransportMessageFrame, OutputTransportMessageFrame,
OutputTransportMessageUrgentFrame, OutputTransportMessageUrgentFrame,
@@ -298,6 +299,8 @@ class WebsocketClientInputTransport(BaseInputTransport):
return return
if isinstance(frame, InputAudioRawFrame) and self._params.audio_in_enabled: if isinstance(frame, InputAudioRawFrame) and self._params.audio_in_enabled:
await self.push_audio_frame(frame) await self.push_audio_frame(frame)
elif isinstance(frame, InputTransportMessageFrame):
await self.broadcast_frame(frame)
else: else:
await self.push_frame(frame) await self.push_frame(frame)

View File

@@ -26,6 +26,7 @@ from pipecat.frames.frames import (
EndFrame, EndFrame,
Frame, Frame,
InputAudioRawFrame, InputAudioRawFrame,
InputTransportMessageFrame,
InterruptionFrame, InterruptionFrame,
OutputAudioRawFrame, OutputAudioRawFrame,
OutputTransportMessageFrame, OutputTransportMessageFrame,
@@ -311,6 +312,8 @@ class FastAPIWebsocketInputTransport(BaseInputTransport):
if isinstance(frame, InputAudioRawFrame): if isinstance(frame, InputAudioRawFrame):
await self.push_audio_frame(frame) await self.push_audio_frame(frame)
elif isinstance(frame, InputTransportMessageFrame):
await self.broadcast_frame(frame)
else: else:
await self.push_frame(frame) await self.push_frame(frame)
except Exception as e: except Exception as e:

View File

@@ -25,6 +25,8 @@ from pipecat.frames.frames import (
EndFrame, EndFrame,
Frame, Frame,
InputAudioRawFrame, InputAudioRawFrame,
InputTransportMessageFrame,
InputTransportMessageUrgentFrame,
InterruptionFrame, InterruptionFrame,
OutputAudioRawFrame, OutputAudioRawFrame,
OutputTransportMessageFrame, OutputTransportMessageFrame,
@@ -214,6 +216,8 @@ class WebsocketServerInputTransport(BaseInputTransport):
if isinstance(frame, InputAudioRawFrame): if isinstance(frame, InputAudioRawFrame):
await self.push_audio_frame(frame) await self.push_audio_frame(frame)
elif isinstance(frame, InputTransportMessageFrame):
await self.broadcast_frame(frame)
else: else:
await self.push_frame(frame) await self.push_frame(frame)
except Exception as e: except Exception as e: