Fix: set output for Message template (#8064)

### What problem does this PR solve?
now Streamning logic is not match with none streaming logic, which may
introduce down stream can not find upstream components.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Stephen Hu
2025-06-05 12:10:40 +08:00
committed by GitHub
parent de89b84661
commit 640fca7dc9

View File

@ -40,7 +40,9 @@ class Message(ComponentBase, ABC):
if kwargs.get("stream"): if kwargs.get("stream"):
return partial(self.stream_output) return partial(self.stream_output)
return Message.be_output(random.choice(self._param.messages)) res = Message.be_output(random.choice(self._param.messages))
self.set_output(res)
return res
def stream_output(self): def stream_output(self):
res = None res = None