浏览代码

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)
tags/v0.13.0
Kevin Hu 1年前
父节点
当前提交
a005be7c74
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1
    1
      agent/component/generate.py

+ 1
- 1
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])[

正在加载...
取消
保存