Skip to content

The agent engineering platform.

PydanticOutputParser doc nb: use langchain.pydantic_v1; remove unused imports (#10651)

Joshua Sundance Bailey0a1dc04875fd
diff --git a/docs/extras/modules/model_io/output_parsers/pydantic.ipynb b/docs/extras/modules/model_io/output_parsers/pydantic.ipynb
index 14137fc2d6..d72ed8cf23 100644
--- a/docs/extras/modules/model_io/output_parsers/pydantic.ipynb
+++ b/docs/extras/modules/model_io/output_parsers/pydantic.ipynb
@@ -13,22 +13,6 @@
"Use Pydantic to declare your data model. Pydantic's BaseModel is like a Python dataclass, but with actual type checking + coercion."
]
},
- {
- "cell_type": "code",
- "execution_count": 1,
- "id": "b322c447",
- "metadata": {},
- "outputs": [],
- "source": [
- "from langchain.prompts import (\n",
- " PromptTemplate,\n",
- " ChatPromptTemplate,\n",
- " HumanMessagePromptTemplate,\n",
- ")\n",
- "from langchain.llms import OpenAI\n",
- "from langchain.chat_models import ChatOpenAI"
- ]
- },
{
"cell_type": "code",
"execution_count": 2,
@@ -36,9 +20,12 @@
"metadata": {},
"outputs": [],
"source": [
+ "from typing import List\n",
+ "\n",
+ "from langchain.llms import OpenAI\n",
"from langchain.output_parsers import PydanticOutputParser\n",
- "from pydantic import BaseModel, Field, validator\n",
- "from typing import List"
+ "from langchain.prompts import PromptTemplate\n",
+ "from langchain.pydantic_v1 import BaseModel, Field, validator"
]
},
{