Problem
On Python 3.14 (including free-threaded 3.14t), importing zhipuai emits:
/zhipuai/core/_base_compat.py:48: UserWarning: Core Pydantic V1 functionality isn't compatible with Python 3.14 or greater.
from pydantic.v1.typing import (
Pydantic has officially stated that pydantic.v1 is not supported on Python 3.14+. This is currently a warning but will likely break in a future pydantic release.
Root cause
zhipuai/core/_base_compat.py lines 48-55 import from pydantic.v1 when pydantic v2 is detected:
if PYDANTIC_V2:
from pydantic.v1.typing import (
get_args as get_args,
is_union as is_union,
get_origin as get_origin,
is_typeddict as is_typeddict,
is_literal_type as is_literal_type,
)
from pydantic.v1.datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime
Suggested fix
All these functions have stdlib equivalents available since Python 3.8-3.12:
pydantic.v1 import |
stdlib replacement |
get_args |
typing.get_args |
get_origin |
typing.get_origin |
is_union |
typing.get_origin(tp) is Union or isinstance(tp, types.UnionType) |
is_literal_type |
typing.get_origin(tp) is Literal |
is_typeddict |
typing.is_typeddict (3.12+) or typing_extensions.is_typeddict |
parse_date / parse_datetime |
manual parsing or dateutil.parser |
This is the only file in the package that references pydantic.v1.
Environment
- Python 3.14t (free-threaded)
- pydantic 2.12.5
- zhipuai 2.1.5.20250825
Problem
On Python 3.14 (including free-threaded 3.14t), importing
zhipuaiemits:Pydantic has officially stated that
pydantic.v1is not supported on Python 3.14+. This is currently a warning but will likely break in a future pydantic release.Root cause
zhipuai/core/_base_compat.pylines 48-55 import frompydantic.v1when pydantic v2 is detected:Suggested fix
All these functions have stdlib equivalents available since Python 3.8-3.12:
pydantic.v1importget_argstyping.get_argsget_origintyping.get_originis_uniontyping.get_origin(tp) is Unionorisinstance(tp, types.UnionType)is_literal_typetyping.get_origin(tp) is Literalis_typeddicttyping.is_typeddict(3.12+) ortyping_extensions.is_typeddictparse_date/parse_datetimedateutil.parserThis is the only file in the package that references
pydantic.v1.Environment