From 602cddb15596ba1234b42fa7c82e4c09385fe7c3 Mon Sep 17 00:00:00 2001 From: Tat Dat Duong Date: Wed, 9 Jul 2025 22:30:35 +0200 Subject: [PATCH] Fix broken code --- docs/docs/tutorials/get-started/3-add-memory.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/tutorials/get-started/3-add-memory.md b/docs/docs/tutorials/get-started/3-add-memory.md index cffc9cb47..7b6c28085 100644 --- a/docs/docs/tutorials/get-started/3-add-memory.md +++ b/docs/docs/tutorials/get-started/3-add-memory.md @@ -426,10 +426,9 @@ const State = z.object({ const tools = [new TavilySearch({ maxResults: 2 })]; const llm = new ChatOpenAI({ model: "gpt-4o-mini" }).bindTools(tools); +// highlight-next-line const memory = new MemorySaver(); -async function generateText(content: string) { - const graph = new StateGraph(State) .addNode("chatbot", async (state) => ({ messages: [await llm.invoke(state.messages)], @@ -438,6 +437,7 @@ const graph = new StateGraph(State) .addConditionalEdges("chatbot", toolsCondition, ["tools", END]) .addEdge("tools", "chatbot") .addEdge(START, "chatbot") + // highlight-next-line .compile({ checkpointer: memory }); ```