<langchain_community\llms\chatglm.py>: <Correcting "history"> (#16729)

Use the real "history" provided by the original program instead of
putting "None" in the history.

- **Description:** I change one line in the code to make it return the
"history" of the chat model.
- **Issue:** At the moment it returns only the answers of the chat
model. However the chat model himself provides a history more complet
with the questions of the user.
  - **Dependencies:** no dependencies required for this change,
This commit is contained in:
hulitaitai 2024-01-30 11:50:31 +08:00 committed by GitHub
parent 4a027e622f
commit 32cad38ec6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -125,5 +125,5 @@ class ChatGLM(LLM):
if stop is not None:
text = enforce_stop_tokens(text, stop)
if self.with_history:
self.history = self.history + [[None, parsed_response["response"]]]
self.history = parsed_response["history"]
return text