|
61 | 61 | "\n", |
62 | 62 | "Set `OPENAI_API_KEY` before running. For local Couchbase runs, this notebook also reads `CB_CONN_STR`, `CB_USER`, `CB_PASS`, `CB_BUCKET_NAME`, and `CB_SCOPE_NAME` from the environment.\n", |
63 | 63 | "\n", |
64 | | - "For the local example below, create bucket `test`, scope `langgraph`, and the `checkpoints` / `checkpoint_writes` collections first, or provide equivalent names through the environment variables.\n" |
| 64 | + "For the local example below, create bucket `test`, scope `langgraph`, and the `checkpoints` / `checkpoint_writes` collections first, or provide equivalent names through the environment variables. The default `CB_*` values shown later are for local development only.\n" |
65 | 65 | ] |
66 | 66 | }, |
67 | 67 | { |
|
134 | 134 | "from typing import Literal\n", |
135 | 135 | "from langchain_core.tools import tool\n", |
136 | 136 | "from langchain_openai import ChatOpenAI\n", |
137 | | - "from langgraph.prebuilt import create_react_agent\n", |
| 137 | + "from langchain.agents import create_agent\n", |
138 | 138 | "\n", |
139 | 139 | "\n", |
140 | 140 | "@tool\n", |
|
188 | 188 | " bucket_name=CB_BUCKET_NAME,\n", |
189 | 189 | " scope_name=CB_SCOPE_NAME,\n", |
190 | 190 | ") as checkpointer:\n", |
191 | | - " graph = create_react_agent(model, tools=tools, checkpointer=checkpointer)\n", |
| 191 | + " graph = create_agent(model, tools=tools, checkpointer=checkpointer)\n", |
192 | 192 | " config = {\"configurable\": {\"thread_id\": \"1\"}}\n", |
193 | 193 | " res = graph.invoke({\"messages\": [(\"human\", \"what's the weather in sf\")]}, config)\n", |
194 | 194 | " \n", |
|
319 | 319 | " bucket_name=CB_BUCKET_NAME,\n", |
320 | 320 | " scope_name=CB_SCOPE_NAME,\n", |
321 | 321 | ") as checkpointer:\n", |
322 | | - " graph = create_react_agent(model, tools=tools, checkpointer=checkpointer)\n", |
| 322 | + " graph = create_agent(model, tools=tools, checkpointer=checkpointer)\n", |
323 | 323 | " config = {\"configurable\": {\"thread_id\": \"2\"}}\n", |
324 | 324 | " res = await graph.ainvoke(\n", |
325 | 325 | " {\"messages\": [(\"human\", \"what's the weather in nyc\")]}, config\n", |
|
0 commit comments