Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

fix `switch` bug (#3280)

Kevin Huf16ef5797921
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 @@ class Switch(ComponentBase, ABC):
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"])