From d1a55c606344de25c029af46ae1259c689f366a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Fri, 6 Dec 2024 17:51:09 -0800 Subject: [PATCH] rtvi: handle transport urgent frames --- src/pipecat/processors/frameworks/rtvi.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pipecat/processors/frameworks/rtvi.py b/src/pipecat/processors/frameworks/rtvi.py index 0e1f3cf5c..d676df72a 100644 --- a/src/pipecat/processors/frameworks/rtvi.py +++ b/src/pipecat/processors/frameworks/rtvi.py @@ -657,6 +657,8 @@ class RTVIProcessor(FrameProcessor): elif isinstance(frame, ErrorFrame): await self._send_error_frame(frame) await self.push_frame(frame, direction) + elif isinstance(frame, TransportMessageUrgentFrame): + await self._handle_transport_message(frame) # All other system frames elif isinstance(frame, SystemFrame): await self.push_frame(frame, direction) @@ -667,8 +669,6 @@ class RTVIProcessor(FrameProcessor): await self.push_frame(frame, direction) await self._stop(frame) # Data frames - elif isinstance(frame, TransportMessageFrame): - await self._handle_transport_message(frame) elif isinstance(frame, RTVIActionFrame): await self._action_queue.put(frame) # Other frames @@ -722,7 +722,7 @@ class RTVIProcessor(FrameProcessor): except asyncio.CancelledError: break - async def _handle_transport_message(self, frame: TransportMessageFrame): + async def _handle_transport_message(self, frame: TransportMessageUrgentFrame): try: message = RTVIMessage.model_validate(frame.message) await self._message_queue.put(message)