Skip to content

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

fix re.escape problem (#2735)

Kevin Hua005be7c744d
diff --git a/agent/component/generate.py b/agent/component/generate.py
index 63ac7dd3e1..6cece8fd6e 100644
--- a/agent/component/generate.py
+++ b/agent/component/generate.py
@@ -112,7 +112,7 @@ class Generate(ComponentBase):
kwargs["input"] = input
for n, v in kwargs.items():
- prompt = re.sub(r"\{%s\}" % n, re.escape(str(v)), prompt)
+ prompt = re.sub(r"\{%s\}" % re.escape(n), str(v), prompt)
downstreams = self._canvas.get_component(self._id)["downstream"]
if kwargs.get("stream") and len(downstreams) == 1 and self._canvas.get_component(downstreams[0])[