fix no resualt bugs (#1448)

### What problem does this PR solve?

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu
2024-07-09 18:06:09 +08:00
committed by GitHub
parent fb66b1e726
commit 30b88e2b91
5 changed files with 14 additions and 9 deletions

View File

@ -46,7 +46,11 @@ class Message(ComponentBase, ABC):
return Message.be_output(random.choice(self._param.messages))
def stream_output(self):
res = None
if self._param.messages:
yield {"content": random.choice(self._param.messages)}
res = {"content": random.choice(self._param.messages)}
yield res
self.set_output(res)