From 3da2713172e7cf5f526e33d595e95ed1f82e45e1 Mon Sep 17 00:00:00 2001 From: Eugene Yurtsev Date: Thu, 8 Aug 2024 12:10:44 -0400 Subject: [PATCH] docs: Update pydantic compatibility (#25145) Update pydantic compatibility --- docs/docs/how_to/pydantic_compatibility.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/docs/how_to/pydantic_compatibility.md b/docs/docs/how_to/pydantic_compatibility.md index 93d03d4ede..3e49395160 100644 --- a/docs/docs/how_to/pydantic_compatibility.md +++ b/docs/docs/how_to/pydantic_compatibility.md @@ -13,9 +13,14 @@ the v1 namespace of Pydantic 2. Because Pydantic does not support mixing .v1 and .v2 objects, users should be aware of a number of issues when using LangChain with Pydantic. +:::caution +While LangChain supports Pydantic V2 objects in some APIs (listed below), it's suggested that users keep using Pydantic V1 objects until LangChain 0.3 is released. +::: + + ## 1. Passing Pydantic objects to LangChain APIs -Most LangChain APIs that accept Pydantic objects have been updated to accept both Pydantic v1 and v2 objects. +Most LangChain APIs for *tool usage* (see list below) have been updated to accept either Pydantic v1 or v2 objects. * Pydantic v1 objects correspond to subclasses of `pydantic.BaseModel` if `pydantic 1` is installed or subclasses of `pydantic.v1.BaseModel` if `pydantic 2` is installed. * Pydantic v2 objects correspond to subclasses of `pydantic.BaseModel` if `pydantic 2` is installed.