examples: make sure unhandled frames are always pushed

This commit is contained in:
Aleix Conchillo Flaqué
2025-01-30 13:15:49 -08:00
parent 642affb2fe
commit 0131d0a531
4 changed files with 8 additions and 1 deletions

View File

@@ -117,12 +117,15 @@ class CompletenessCheck(FrameProcessor):
async def process_frame(self, frame: Frame, direction: FrameDirection):
await super().process_frame(frame, direction)
if isinstance(frame, TextFrame) and frame.text == "YES":
logger.debug("Completeness check YES")
await self.push_frame(UserStoppedSpeakingFrame())
await self._notifier.notify()
elif isinstance(frame, TextFrame) and frame.text == "NO":
logger.debug("Completeness check NO")
else:
await self.push_frame(frame, direction)
class OutputGate(FrameProcessor):