From 32cad38ec6a679a497a1698ad833b8a1fdd58f75 Mon Sep 17 00:00:00 2001 From: hulitaitai <146365078+hulitaitai@users.noreply.github.com> Date: Tue, 30 Jan 2024 11:50:31 +0800 Subject: [PATCH] : (#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, --- libs/community/langchain_community/llms/chatglm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/community/langchain_community/llms/chatglm.py b/libs/community/langchain_community/llms/chatglm.py index 84e2294c05d..bdd55946606 100644 --- a/libs/community/langchain_community/llms/chatglm.py +++ b/libs/community/langchain_community/llms/chatglm.py @@ -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