From a005be7c744d8cfac08fec1155f22d0b238c4299 Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Tue, 8 Oct 2024 10:07:03 +0800 Subject: [PATCH] fix re.escape problem (#2735) ### What problem does this PR solve? #2716 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- agent/component/generate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/component/generate.py b/agent/component/generate.py index 63ac7dd3e..6cece8fd6 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])[