services: ignore yielded None values

This commit is contained in:
Aleix Conchillo Flaqué
2024-07-31 23:41:03 -07:00
parent 27a09c0b2c
commit faf41c0b36
2 changed files with 8 additions and 4 deletions

View File

@@ -26,6 +26,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Fixed an issue in `AIService` that would cause a yielded `None` value to be
processed.
- RTVI's `bot-ready` message is now sent when the RTVI pipeline is ready and
a first participant joins.

View File

@@ -75,10 +75,11 @@ class AIService(FrameProcessor):
async def process_generator(self, generator: AsyncGenerator[Frame, None]):
async for f in generator:
if isinstance(f, ErrorFrame):
await self.push_error(f)
else:
await self.push_frame(f)
if f:
if isinstance(f, ErrorFrame):
await self.push_error(f)
else:
await self.push_frame(f)
class AsyncAIService(AsyncFrameProcessor):