Make example work during pydantic transition (#11498)

**Description:**

Make the example extraction code on
https://python.langchain.com/docs/use_cases/extraction work again by
importing the langchain.pydantic_v1 lib instead of the v2.

**Issue:**

Solves issue https://github.com/langchain-ai/langchain/issues/11468

Co-authored-by: Martin van Hensbergen <martin@mvhensbergen.com>
Co-authored-by: Bagatur <baskaryan@gmail.com>
pull/11400/head^2
mvhensbergen 11 months ago committed by GitHub
parent a477ddda45
commit 629d9b78fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -379,8 +379,8 @@
}
],
"source": [
"from typing import Optional, List\n",
"from pydantic import BaseModel, Field\n",
"from typing import Optional\n",
"from langchain.pydantic_v1 import BaseModel\n",
"from langchain.chains import create_extraction_chain_pydantic\n",
"\n",
"# Pydantic data class\n",

Loading…
Cancel
Save