docs: update pydantic comments -> callouts in tutorials (#1825)

This commit is contained in:
Vadym Barda
2024-09-24 13:09:59 +00:00
committed by GitHub
parent bb5ff42bcd
commit 37948b3348
16 changed files with 218 additions and 19 deletions
@@ -3086,6 +3086,19 @@
"Each *specialized* / delegated assistant additionally can call the `CompleteOrEscalate` tool to indicate that the control flow should be passed back to the primary assistant. This happens if it has successfully completed its work or if the user has changed their mind or needs assistance on something that beyond the scope of that particular workflow."
]
},
{
"cell_type": "markdown",
"id": "b46da448-a1fc-4309-80db-4b7feed9f96b",
"metadata": {},
"source": [
"<div class=\"admonition note\">\n",
" <p class=\"admonition-title\">Using Pydantic with LangChain</p>\n",
" <p>\n",
" This notebook uses Pydantic v2 <code>BaseModel</code>, which requires <code>langchain-core >= 0.3</code>. Using <code>langchain-core < 0.3</code> will result in errors due to mixing of Pydantic v1 and v2 <code>BaseModels</code>.\n",
" </p>\n",
"</div>"
]
},
{
"cell_type": "code",
"execution_count": 43,
@@ -3097,7 +3110,7 @@
"from langchain_community.tools.tavily_search import TavilySearchResults\n",
"from langchain_core.prompts import ChatPromptTemplate\n",
"from langchain_core.runnables import Runnable, RunnableConfig\n",
"# NOTE: you must use langchain-core >= 0.3 with Pydantic v2\n",
"\n",
"from pydantic import BaseModel, Field\n",
"\n",
"\n",