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

@@ -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):