|
49 | 49 | "### Install dependencies\n",
|
50 | 50 | "\n",
|
51 | 51 | "```bash\n",
|
52 |
| - "npm install cheerio zod langchain @langchain/community @langchain/openai @langchain/core @langchain/textsplitters @langchain/langgraph\n", |
| 52 | + "npm install cheerio zod langchain @langchain/community @langchain/openai @langchain/core @langchain/textsplitters @langchain/langgraph @langchain/tavily\n", |
53 | 53 | "```"
|
54 | 54 | ]
|
55 | 55 | },
|
|
206 | 206 | },
|
207 | 207 | {
|
208 | 208 | "cell_type": "code",
|
209 |
| - "execution_count": 4, |
| 209 | + "execution_count": null, |
210 | 210 | "metadata": {},
|
211 | 211 | "outputs": [],
|
212 | 212 | "source": [
|
213 |
| - "import { TavilySearchResults } from \"@langchain/community/tools/tavily_search\";\n", |
| 213 | + "import { TavilySearch } from \"@langchain/tavily\";\n", |
214 | 214 | "import { Document } from \"@langchain/core/documents\";\n",
|
215 | 215 | "import { z } from \"zod\";\n",
|
216 | 216 | "import { ChatPromptTemplate } from \"@langchain/core/prompts\";\n",
|
|
378 | 378 | "): Promise<Partial<typeof GraphState.State>> {\n",
|
379 | 379 | " console.log(\"---WEB SEARCH---\");\n",
|
380 | 380 | "\n",
|
381 |
| - " const tool = new TavilySearchResults();\n", |
382 |
| - " const docs = await tool.invoke({ input: state.question });\n", |
| 381 | + " const tool = new TavilySearch();\n", |
| 382 | + " const docs = await tool.invoke({ query: state.question });\n", |
383 | 383 | " const webResults = new Document({ pageContent: docs });\n",
|
384 | 384 | " const newDocuments = state.documents.concat(webResults);\n",
|
385 | 385 | "\n",
|
|
0 commit comments