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 @@ def _run(self, history, **kwargs): 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])[