mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-13 13:36:15 +00:00
standard-tests: rename langchain_standard_tests to langchain_tests, release 0.3.2 (#28203)
This commit is contained in:
14
libs/standard-tests/langchain_tests/utils/pydantic.py
Normal file
14
libs/standard-tests/langchain_tests/utils/pydantic.py
Normal file
@@ -0,0 +1,14 @@
|
||||
"""Utilities for working with pydantic models."""
|
||||
|
||||
|
||||
def get_pydantic_major_version() -> int:
|
||||
"""Get the major version of Pydantic."""
|
||||
try:
|
||||
import pydantic
|
||||
|
||||
return int(pydantic.__version__.split(".")[0])
|
||||
except ImportError:
|
||||
return 0
|
||||
|
||||
|
||||
PYDANTIC_MAJOR_VERSION = get_pydantic_major_version()
|
Reference in New Issue
Block a user