diff --git a/weave/weave_pydantic.py b/weave/legacy/weave_pydantic.py similarity index 93% rename from weave/weave_pydantic.py rename to weave/legacy/weave_pydantic.py index 19d200ad2fd..086feb8d2fa 100644 --- a/weave/weave_pydantic.py +++ b/weave/legacy/weave_pydantic.py @@ -1,7 +1,7 @@ from pydantic import BaseModel, create_model -from . import weave_types as types -from .legacy import infer_types +from .. import weave_types as types +from . import infer_types def weave_type_to_pydantic( diff --git a/weave/serve_fastapi.py b/weave/serve_fastapi.py index d6b23431349..ca63901d03b 100644 --- a/weave/serve_fastapi.py +++ b/weave/serve_fastapi.py @@ -17,7 +17,8 @@ from weave.trace.op import Op from weave.trace.refs import ObjectRef -from . import errors, weave_pydantic +from . import errors +from .legacy import weave_pydantic key_cache: cache.LruTimeWindowCache[str, typing.Optional[bool]] = ( cache.LruTimeWindowCache(datetime.timedelta(minutes=5)) diff --git a/weave/weave_types.py b/weave/weave_types.py index 990ec2586a8..bee5df4bd11 100644 --- a/weave/weave_types.py +++ b/weave/weave_types.py @@ -1057,7 +1057,7 @@ def property_types(self) -> dict[str, Type]: @classmethod def typeclass_of_class(cls, check_class): - from . import weave_pydantic + from .legacy import weave_pydantic if not issubclass(check_class, pydantic.BaseModel): return cls