mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-10-23 01:49:58 +00:00
34 lines
663 B
Python
34 lines
663 B
Python
import pydantic
|
|
|
|
if pydantic.VERSION.startswith("1."):
|
|
PYDANTIC_VERSION = 1
|
|
from pydantic import (
|
|
BaseModel,
|
|
Extra,
|
|
Field,
|
|
NonNegativeFloat,
|
|
NonNegativeInt,
|
|
PositiveFloat,
|
|
PositiveInt,
|
|
ValidationError,
|
|
root_validator,
|
|
validator,
|
|
PrivateAttr,
|
|
)
|
|
else:
|
|
PYDANTIC_VERSION = 2
|
|
# pydantic 2.x
|
|
from pydantic.v1 import (
|
|
BaseModel,
|
|
Extra,
|
|
Field,
|
|
NonNegativeFloat,
|
|
NonNegativeInt,
|
|
PositiveFloat,
|
|
PositiveInt,
|
|
ValidationError,
|
|
root_validator,
|
|
validator,
|
|
PrivateAttr,
|
|
)
|