瀏覽代碼

Fix bug : bad escape \x at position xxx (line xx, column xx) in agent (#2226)

### What problem does this PR solve?

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

---------

Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>
tags/v0.11.0
H 1 年之前
父節點
當前提交
4f05803690
No account linked to committer's email address
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1
    2
      agent/component/generate.py

+ 1
- 2
agent/component/generate.py 查看文件

@@ -112,8 +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\}" % n, str(v), prompt)
prompt = re.sub(r"\{%s\}" % n, re.escape(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])[

Loading…
取消
儲存