mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-31 12:19:58 +02:00
docs: update pydantic comments -> callouts in tutorials (#1825)
This commit is contained in:
@@ -339,6 +339,19 @@
|
||||
"Create a `solver` node that prompts an LLM \"agent\" to use a [writePython tool](https://python.langchain.com/docs/integrations/chat/anthropic/#integration-details) to generate the submitted code."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "7c1f057e-b2cb-4085-9f4b-54ef005df0c6",
|
||||
"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": 7,
|
||||
@@ -348,7 +361,7 @@
|
||||
"source": [
|
||||
"from langchain_core.language_models import BaseChatModel\n",
|
||||
"from langchain_core.prompts import ChatPromptTemplate\n",
|
||||
"# NOTE: you must use langchain-core >= 0.3 with Pydantic v2\n",
|
||||
"\n",
|
||||
"from pydantic import BaseModel, Field\n",
|
||||
"\n",
|
||||
"\n",
|
||||
|
||||
Reference in New Issue
Block a user