Skip to content

The agent engineering platform.

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

hulitaitai32cad38ec6a6
diff --git a/libs/community/langchain_community/llms/chatglm.py b/libs/community/langchain_community/llms/chatglm.py
index 84e2294c05..bdd5594660 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