mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-25 11:05:12 +02:00
docs: remove mentions of pydantic_v1 in tutorials (#1709)
This commit is contained in:
@@ -394,7 +394,8 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from langchain_core.pydantic_v1 import BaseModel, Field, validator\n",
|
||||
"# NOTE: you must use langchain-core >= 0.3 with Pydantic v2\n",
|
||||
"from pydantic import BaseModel, Field, field_validator\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"class Respond(BaseModel):\n",
|
||||
@@ -403,7 +404,7 @@
|
||||
" reason: str = Field(description=\"Step-by-step justification for the answer.\")\n",
|
||||
" answer: str\n",
|
||||
"\n",
|
||||
" @validator(\"answer\")\n",
|
||||
" @field_validator(\"answer\")\n",
|
||||
" def reason_contains_apology(cls, answer: str):\n",
|
||||
" if \"llama\" not in answer.lower():\n",
|
||||
" raise ValueError(\n",
|
||||
@@ -1038,7 +1039,7 @@
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.12.2"
|
||||
"version": "3.11.9"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
||||
Reference in New Issue
Block a user