code review

This commit is contained in:
vbarda
2024-06-17 15:25:47 -04:00
parent 0b703444a1
commit fe464591f7
2 changed files with 20 additions and 14 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ _MANUAL = {
"configuration.ipynb",
"map-reduce.ipynb",
"extraction/retries.ipynb",
"create-react-agent.ipynb"
"create-react-agent.ipynb",
],
"tutorials": [
"introduction.ipynb",
+19 -13
View File
@@ -9,14 +9,14 @@
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "a213e11a-5c62-4ddb-a707-490d91add383",
"cell_type": "markdown",
"id": "e0fcced0-9767-412f-90f9-7f3cd618ff90",
"metadata": {},
"outputs": [],
"source": [
"%%capture --no-stderr\n",
"%pip install -U langgraph langchain-openai"
"In this how-to we'll create a simple [ReAct](https://arxiv.org/abs/2210.03629) agent app that can check the weather. The app consists of an agent (LLM) and tools. As we interact with the app, we will first call the agent (LLM) to decide if we should use tools. Then we will run a loop: \n",
"\n",
"1. If the agent said to take an action (i.e. call tool), we'll run the tools and pass the results back to the agent\n",
"2. If the agent did not ask to run tools, we will finish (respond to the user)"
]
},
{
@@ -27,6 +27,17 @@
"## Setup"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "a213e11a-5c62-4ddb-a707-490d91add383",
"metadata": {},
"outputs": [],
"source": [
"%%capture --no-stderr\n",
"%pip install -U langgraph langchain-openai"
]
},
{
"cell_type": "code",
"execution_count": 2,
@@ -64,19 +75,14 @@
"id": "03c0f089-070c-4cd4-87e0-6c51f2477b82",
"metadata": {},
"source": [
"## How to create a simple ReAct agent"
"## How to create a simple ReAct agent with `create_react_agent`"
]
},
{
"cell_type": "markdown",
"id": "f1c8e137-e6e6-4f9f-bd1b-77359a1c4ec5",
"id": "91efaf20-711b-4b94-837e-dcef10d8abdd",
"metadata": {},
"source": [
"Let's create a simple ReAct agent app that can check the weather. The app consists of an agent (LLM) and tools. As we interact with the app, we will first call the agent (LLM) to decide if we should use tools. Then we will run a loop: \n",
"\n",
"1. If the agent said to take an action (i.e. call tool), we'll run the tools and pass the results back to the agent\n",
"2. If the agent did not ask to run tools, we will finish (respond to the user)\n",
"\n",
"In our example we'll use `ChatOpenAI` as our agent and a custom tool that returns pre-defined values for weather in two cities (NYC & SF)"
]
},