From be3724f47eae9d2682b3400ed391437c52c41827 Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Fri, 8 Nov 2024 10:08:57 +0800 Subject: [PATCH] fix `switch` bug (#3280) ### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- agent/component/switch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/component/switch.py b/agent/component/switch.py index bb3a15b52c..84613ee04b 100644 --- a/agent/component/switch.py +++ b/agent/component/switch.py @@ -52,7 +52,7 @@ def _run(self, history, **kwargs): res = [] for item in cond["items"]: out = self._canvas.get_component(item["cpn_id"])["obj"].output()[1] - cpn_input = "" if "content" not in out.columns else " ".join(out["content"]) + cpn_input = "" if "content" not in out.columns else " ".join([str(s) for s in out["content"]]) res.append(self.process_operator(cpn_input, item["operator"], item["value"])) if cond["logical_operator"] != "and" and any(res): return Switch.be_output(cond["to"])