mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-30 19:59:40 +02:00
Fix broken code
This commit is contained in:
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 });
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user