docs: sql_qa.ipynb tutorial update (#21756)

1. Updated deprecated method usage.
2. Added LangGraph required installation in tutorial.

X: MichaelOzery
This commit is contained in:
Michael Ozery 2024-05-16 18:23:20 +03:00 committed by GitHub
parent d77e60a7f4
commit dda5a9c97a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -458,7 +458,22 @@
"metadata": {}, "metadata": {},
"source": [ "source": [
"### Initializing agent\n", "### 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" "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", "from langgraph.prebuilt import chat_agent_executor\n",
"\n", "\n",
"agent_executor = chat_agent_executor.create_tool_calling_executor(\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", "system_message = SystemMessage(content=system)\n",
"\n", "\n",
"agent = chat_agent_executor.create_tool_calling_executor(\n", "agent = chat_agent_executor.create_tool_calling_executor(\n",
" llm, tools, system_message=system_message\n", " llm, tools, messages_modifier=system_message\n",
")" ")"
] ]
}, },