diff --git a/src/pipecat/transports/daily/transport.py b/src/pipecat/transports/daily/transport.py index ff8cd49ba..edab4d711 100644 --- a/src/pipecat/transports/daily/transport.py +++ b/src/pipecat/transports/daily/transport.py @@ -25,6 +25,7 @@ from pydantic import BaseModel from pipecat.audio.vad.vad_analyzer import VADAnalyzer, VADParams from pipecat.frames.frames import ( CancelFrame, + ControlFrame, EndFrame, ErrorFrame, Frame, @@ -115,6 +116,17 @@ class DailyUpdateRemoteParticipantsFrame(DataFrame): remote_participants: Optional[Any] = None +@dataclass +class DailyUpdateRemoteParticipantsFrame(ControlFrame): + """Frame to update remote participants in Daily calls. + + Parameters: + remote_participants: See https://reference-python.daily.co/api_reference.html#daily.CallClient.update_remote_participants. + """ + + remote_participants: Mapping[str, Any] = None + + class WebRTCVADAnalyzer(VADAnalyzer): """Voice Activity Detection analyzer using WebRTC. @@ -1813,6 +1825,18 @@ class DailyOutputTransport(BaseOutputTransport): logger.debug(f"Got a DailyUpdateRemoteParticipantsFrame: {frame}") await self._client.update_remote_participants(frame.remote_participants) + async def process_frame(self, frame: Frame, direction: FrameDirection): + """Process outgoing frames, including transport messages. + + Args: + frame: The frame to process. + direction: The direction of frame flow in the pipeline. + """ + await super().process_frame(frame, direction) + + if isinstance(frame, DailyUpdateRemoteParticipantsFrame): + await self._client.update_remote_participants(frame.remote_participants) + async def send_message(self, frame: TransportMessageFrame | TransportMessageUrgentFrame): """Send a transport message to participants.