@@ -8,14 +8,28 @@ please see our {doc}`contributor's guide </contributors/index>`.
8
8
9
9
## Pydantic compatibility
10
10
11
- Jupyter AI is fully compatible with Python environments using Pydantic v1
12
- or Pydantic v2. Jupyter AI imports Pydantic classes from the
13
- ` langchain.pydantic_v1 ` module. Developers should do the same when they extend
14
- Jupyter AI classes.
15
-
16
- For more details about using ` langchain.pydantic_v1 ` in an environment with
17
- Pydantic v2 installed, see the
18
- [ LangChain documentation on Pydantic compatibility] ( https://python.langchain.com/docs/guides/pydantic_compatibility ) .
11
+ - ` jupyter-ai<2.29.0 ` requires Pydantic v1 ** or** v2, but only supports
12
+ LangChain v0.2, which is now outdated.
13
+
14
+ - Internally, `jupyter-ai<2.29.0` uses the Pydantic v1 API through a
15
+ vendored module provided by LangChain. Therefore, if you are developing
16
+ extensions for `jupyter-ai<2.29.0`, you should import Pydantic objects (e.g.
17
+ `BaseModel`) from the `langchain.pydantic_v1` module. In this context, you
18
+ should *not* use the `pydantic` module (as it may be Pydantic v1 or v2).
19
+
20
+ - ` jupyter-ai>=2.29.0 ` requires Pydantic v2 (** not** v1), but supports LangChain
21
+ ` >=0.3 ` .
22
+
23
+ - Internally, `jupyter-ai>=2.29.0` uses the Pydantic v2 API directly through
24
+ the `pydantic` module. Therefore, if you are developing extensions for
25
+ `jupyter-ai>=2.29.0`, you should import Pydantic objects (e.g. `BaseModel`)
26
+ from the `pydantic` module.
27
+
28
+ - For context, LangChain v0.3 requires Pydantic v2. This motivated the
29
+ upgrade to the Pydantic v2 API.
30
+
31
+ For more details about Pydantic & LangChain version compatibility, see the
32
+ [ LangChain documentation on Pydantic compatibility] ( https://python.langchain.com/docs/how_to/pydantic_compatibility/ ) .
19
33
20
34
## Jupyter AI module cookiecutter
21
35
0 commit comments