Use create_react_agent (#441)

This commit is contained in:
William FH
2024-05-13 14:32:26 -07:00
committed by GitHub
parent 1100360ea6
commit 2c32a38c42
7 changed files with 157 additions and 115 deletions
@@ -5,7 +5,7 @@
"id": "8bcd1a3d-7c50-4f58-be4e-1ed654aa33be",
"metadata": {},
"source": [
"# Chat Executor: with tool calling\n",
"# ReAct agent with tool calling\n",
"\n",
"This notebook walks through an example creating a ReAct Agent that uses tool calling.\n",
"This is useful for getting started quickly.\n",
@@ -32,7 +32,7 @@
"source": [
"from langchain_openai import ChatOpenAI\n",
"from langchain_community.tools.tavily_search import TavilySearchResults\n",
"from langgraph.prebuilt import chat_agent_executor\n",
"from langgraph.prebuilt import create_react_agent\n",
"from langchain_core.messages import HumanMessage"
]
},
@@ -64,7 +64,7 @@
"metadata": {},
"outputs": [],
"source": [
"app = chat_agent_executor.create_tool_calling_executor(model, tools)"
"app = create_react_agent(model, tools=tools)"
]
},
{