Fix broken code

This commit is contained in:
Tat Dat Duong
2025-07-28 14:56:27 -07:00
committed by Hunter Lovell
parent a328d43c53
commit 602cddb155
@@ -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 });
```