Skip to content

Commit

Permalink
fix re.escape problem
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinHuSh committed Oct 8, 2024
1 parent 6f7fcdc commit b88245d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion agent/component/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])[
Expand Down

0 comments on commit b88245d

Please sign in to comment.