Skip to content

The agent engineering platform.

community: update import in chatbot tutorial to use InMemoryChatMessageHistory (#23903)

Robbie Cronin0990ab146c1d
diff --git a/docs/docs/tutorials/chatbot.ipynb b/docs/docs/tutorials/chatbot.ipynb
index 5072d2c471..05f73ef952 100644
--- a/docs/docs/tutorials/chatbot.ipynb
+++ b/docs/docs/tutorials/chatbot.ipynb
@@ -270,8 +270,10 @@
"metadata": {},
"outputs": [],
"source": [
- "from langchain_community.chat_message_histories import ChatMessageHistory\n",
- "from langchain_core.chat_history import BaseChatMessageHistory\n",
+ "from langchain_core.chat_history import (\n",
+ " BaseChatMessageHistory,\n",
+ " InMemoryChatMessageHistory,\n",
+ ")\n",
"from langchain_core.runnables.history import RunnableWithMessageHistory\n",
"\n",
"store = {}\n",
@@ -279,7 +281,7 @@
"\n",
"def get_session_history(session_id: str) -> BaseChatMessageHistory:\n",
" if session_id not in store:\n",
- " store[session_id] = ChatMessageHistory()\n",
+ " store[session_id] = InMemoryChatMessageHistory()\n",
" return store[session_id]\n",
"\n",
"\n",