mirror of
https://github.com/hwchase17/langchain.git
synced 2026-03-18 02:53:16 +00:00
Co-authored-by: Mohammad Mohtashim <45242107+keenborder786@users.noreply.github.com> Co-authored-by: Caspar Broekhuizen <caspar@langchain.dev> Co-authored-by: ccurme <chester.curme@gmail.com> Co-authored-by: Christophe Bornet <cbornet@hotmail.com> Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com> Co-authored-by: Sadra Barikbin <sadraqazvin1@yahoo.com> Co-authored-by: Vadym Barda <vadim.barda@gmail.com>
15 lines
341 B
Python
15 lines
341 B
Python
"""Utilities for working with pydantic models."""
|
|
|
|
|
|
def get_pydantic_major_version() -> int:
|
|
"""Get the major version of Pydantic."""
|
|
try:
|
|
import pydantic # noqa: PLC0415
|
|
|
|
return int(pydantic.__version__.split(".")[0])
|
|
except ImportError:
|
|
return 0
|
|
|
|
|
|
PYDANTIC_MAJOR_VERSION = get_pydantic_major_version()
|