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>
This commit is contained in:
mvhensbergen 2023-10-12 03:44:47 +02:00 committed by GitHub
parent a477ddda45
commit 629d9b78fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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