Kevin Hu commited on
Commit
b85ddd8
·
1 Parent(s): df34f9b

fix component rewrite bug (#2549)

Browse files

### What problem does this PR solve?

#2545

### Type of change

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

Files changed (1) hide show
  1. agent/component/rewrite.py +2 -0
agent/component/rewrite.py CHANGED
@@ -65,6 +65,8 @@ class RewriteQuestion(Generate, ABC):
65
  chat_mdl = LLMBundle(self._canvas.get_tenant_id(), LLMType.CHAT, self._param.llm_id)
66
  ans = chat_mdl.chat(self._param.get_prompt(), [{"role": "user", "content": q}],
67
  self._param.gen_conf())
 
 
68
 
69
  print(ans, ":::::::::::::::::::::::::::::::::")
70
  return RewriteQuestion.be_output(ans)
 
65
  chat_mdl = LLMBundle(self._canvas.get_tenant_id(), LLMType.CHAT, self._param.llm_id)
66
  ans = chat_mdl.chat(self._param.get_prompt(), [{"role": "user", "content": q}],
67
  self._param.gen_conf())
68
+ self._canvas.history.pop()
69
+ self._canvas.history.append(("user", ans))
70
 
71
  print(ans, ":::::::::::::::::::::::::::::::::")
72
  return RewriteQuestion.be_output(ans)