From 420534c8ca637b985cb74b5828fd955e4ab48585 Mon Sep 17 00:00:00 2001 From: Hassan-Memon <58885416+Hassan-Memon@users.noreply.github.com> Date: Mon, 12 Aug 2024 18:24:51 +0500 Subject: [PATCH] =?UTF-8?q?docs:=20Replaced=20SqliteSaver=20with=20MemoryS?= =?UTF-8?q?aver=20and=20updated=20installation=20instru=E2=80=A6=20(#25285?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …ctions to match LangGraph v2 documentation. Corrected code snippet to prevent validation errors. Here's how you can fill out the provided template for your pull request: --- **Thank you for contributing to LangChain!** - [ ] **PR title**: `docs: update checkpointer example in Conversational RAG tutorial` - [ ] **PR message**: - **Description:** Updated the Conversational RAG tutorial to correct the checkpointer example by replacing `SqliteSaver` with `MemorySaver`. Added installation instructions for `langgraph-checkpoint-memory` to match LangGraph v2 documentation and prevent validation errors. - **Issue:** N/A - **Dependencies:** `langgraph-checkpoint-memory` - **Twitter handle:** N/A - [ ] **Add tests and docs**: 1. No new integration tests are required. 2. Updated documentation in the Conversational RAG tutorial. - [ ] **Lint and test**: Run `make format`, `make lint` and `make test` from the root of the package(s) you've modified. See contribution guidelines for more: [LangChain Contribution Guidelines](https://python.langchain.com/docs/contributing/) Additional guidelines: - Make sure optional dependencies are imported within a function. - Please do not add dependencies to pyproject.toml files (even optional ones) unless they are required for unit tests. - Most PRs should not touch more than one package. - Changes should be backwards compatible. - If you are adding something to community, do not re-import it in langchain. If no one reviews your PR within a few days, please @-mention one of baskaryan, efriis, eyurtsev, ccurme, vbarda, hwchase17. --- docs/docs/tutorials/qa_chat_history.ipynb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/docs/tutorials/qa_chat_history.ipynb b/docs/docs/tutorials/qa_chat_history.ipynb index aa1cae5265..ef8a47be3d 100644 --- a/docs/docs/tutorials/qa_chat_history.ipynb +++ b/docs/docs/tutorials/qa_chat_history.ipynb @@ -857,9 +857,9 @@ "metadata": {}, "outputs": [], "source": [ - "from langgraph.checkpoint.sqlite import SqliteSaver\n", + "from langgraph.checkpoint.memory import MemorySaver\n", "\n", - "memory = SqliteSaver.from_conn_string(\":memory:\")\n", + "memory = MemorySaver()\n", "\n", "agent_executor = create_react_agent(llm, tools, checkpointer=memory)" ] @@ -1022,10 +1022,10 @@ "from langchain_core.runnables.history import RunnableWithMessageHistory\n", "from langchain_openai import ChatOpenAI, OpenAIEmbeddings\n", "from langchain_text_splitters import RecursiveCharacterTextSplitter\n", - "from langgraph.checkpoint.sqlite import SqliteSaver\n", + "from langgraph.checkpoint.memory import MemorySaver\n", "from langgraph.prebuilt import create_react_agent\n", "\n", - "memory = SqliteSaver.from_conn_string(\":memory:\")\n", + "memory = MemorySaver()\n", "llm = ChatOpenAI(model=\"gpt-3.5-turbo\", temperature=0)\n", "\n", "\n",