|
|
|
@ -458,7 +458,22 @@
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"### Initializing agent\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"First, get required package **LangGraph**"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": null,
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"outputs": [],
|
|
|
|
|
"source": [
|
|
|
|
|
"%pip install --upgrade --quiet langgraph"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"We will use a prebuilt [LangGraph](/docs/concepts/#langgraph) agent to build our agent"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
@ -472,7 +487,7 @@
|
|
|
|
|
"from langgraph.prebuilt import chat_agent_executor\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"agent_executor = chat_agent_executor.create_tool_calling_executor(\n",
|
|
|
|
|
" llm, tools, system_message=system_message\n",
|
|
|
|
|
" llm, tools, messages_modifier=system_message\n",
|
|
|
|
|
")"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
@ -711,7 +726,7 @@
|
|
|
|
|
"system_message = SystemMessage(content=system)\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"agent = chat_agent_executor.create_tool_calling_executor(\n",
|
|
|
|
|
" llm, tools, system_message=system_message\n",
|
|
|
|
|
" llm, tools, messages_modifier=system_message\n",
|
|
|
|
|
")"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|