PydanticUserError: ConversationSummaryBufferMemory
is not fully defined; you should define BaseCache
, then call ConversationSummaryBufferMemory.model_rebuild()
.
#28257
Labels
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
{
"name": "PydanticUserError",
"message": "
ConversationSummaryBufferMemory
is not fully defined; you should defineBaseCache
, then callConversationSummaryBufferMemory.model_rebuild()
.For further information visit https://errors.pydantic.dev/2.10/u/class-not-fully-defined",
"stack": "---------------------------------------------------------------------------
PydanticUserError Traceback (most recent call last)
Cell In[45], line 3
1 from langchain.memory import ConversationSummaryBufferMemory
----> 3 memory = ConversationSummaryBufferMemory(
4 llm=chat,
5 input_key="input",
6 output_key="output",
7 max_token_limit=1024,
8 memory_key="chat_history",
9 )
File c:\xxxx\site-packages\langchain_core\_api\deprecation.py:216, in deprecated..deprecate..finalize..warn_if_direct_instance(self, *args, **kwargs)
214 warned = True
215 emit_warning()
--> 216 return wrapped(self, *args, **kwargs)
File xxxx\site-packages\langchain_core\_api\deprecation.py:216, in deprecated..deprecate..finalize..warn_if_direct_instance(self, *args, **kwargs)
214 warned = True
215 emit_warning()
--> 216 return wrapped(self, *args, **kwargs)
File xxxx\site-packages\langchain_core\_api\deprecation.py:216, in deprecated..deprecate..finalize..warn_if_direct_instance(self, *args, **kwargs)
214 warned = True
215 emit_warning()
--> 216 return wrapped(self, *args, **kwargs)
File xxxx\site-packages\langchain_core\load\serializable.py:125, in Serializable.init(self, *args, **kwargs)
123 def init(self, *args: Any, **kwargs: Any) -> None:
124 """"""
--> 125 super().init(*args, **kwargs)
File xxxx\site-packages\langchain_core\_api\deprecation.py:216, in deprecated..deprecate..finalize..warn_if_direct_instance(self, *args, **kwargs)
214 warned = True
215 emit_warning()
--> 216 return wrapped(self, *args, **kwargs)
File xxxx\site-packages\pydantic\_internal\_mock_val_ser.py:100, in MockValSer.getattr(self, item)
98 # raise an AttributeError if
item
doesn't exist99 getattr(self._val_or_ser, item)
--> 100 raise PydanticUserError(self._error_message, code=self._code)
PydanticUserError:
ConversationSummaryBufferMemory
is not fully defined; you should defineBaseCache
, then callConversationSummaryBufferMemory.model_rebuild()
.For further information visit https://errors.pydantic.dev/2.10/u/class-not-fully-defined"
}
Description
I've upgrade my project's langchain package to latest, and when i create ConversationSummaryBufferMemory, encountered the PydanticUserError
System Info
System Information
Package Information
Optional packages not installed
Other Dependencies
The text was updated successfully, but these errors were encountered: