From 640fca7dc956879ce5e2f5485eed57fa2a6edc42 Mon Sep 17 00:00:00 2001 From: Stephen Hu Date: Thu, 5 Jun 2025 12:10:40 +0800 Subject: [PATCH] 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) --- agent/component/message.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/agent/component/message.py b/agent/component/message.py index a193dd122..c60d4d307 100644 --- a/agent/component/message.py +++ b/agent/component/message.py @@ -40,7 +40,9 @@ class Message(ComponentBase, ABC): if kwargs.get("stream"): 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): res = None