Merge pull request #801 from pipecat-ai/aleix/rtvi-handle-transport-urgent-frames
rtvi: handle transport urgent frames
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user