Revert the chat history for rewrite. (#4579)

### What problem does this PR solve?


### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu
2025-01-22 16:55:11 +08:00
committed by GitHub
parent 4b82275ae5
commit cbc3c5297e
4 changed files with 5 additions and 5 deletions

View File

@ -483,7 +483,7 @@ class ComponentBase(ABC):
if q["component_id"].lower().find("answer") == 0:
txt = []
for r, c in self._canvas.history[::-1][:self._param.message_history_window_size]:
for r, c in self._canvas.history[::-1][:self._param.message_history_window_size][::-1]:
txt.append(f"{r.upper()}: {c}")
txt = "\n".join(txt)
self._param.inputs.append({"content": txt, "component_id": q["component_id"]})