@@ -105,14 +105,6 @@ class _MockSchema(BaseModel):
105105 arg3 : dict | None = None
106106
107107
108- class _MockSchemaV1 (BaseModelV1 ):
109- """Return the arguments directly."""
110-
111- arg1 : int
112- arg2 : bool
113- arg3 : dict | None = None
114-
115-
116108class _MockStructuredTool (BaseTool ):
117109 name : str = "structured_api"
118110 args_schema : type [BaseModel ] = _MockSchema
@@ -206,6 +198,20 @@ def tool_func(*, arg1: int, arg2: bool, arg3: dict | None = None) -> str:
206198 assert isinstance (tool_func , BaseTool )
207199 assert tool_func .args_schema == _MockSchema
208200
201+
202+ @pytest .mark .skipif (
203+ sys .version_info >= (3 , 14 ), reason = "Pydantic v1 not supported with Python 3.14+"
204+ )
205+ def test_decorator_with_specified_schema_pydantic_v1 () -> None :
206+ """Test that manually specified schemata are passed through to the tool."""
207+
208+ class _MockSchemaV1 (BaseModelV1 ):
209+ """Return the arguments directly."""
210+
211+ arg1 : int
212+ arg2 : bool
213+ arg3 : dict | None = None
214+
209215 @tool (args_schema = cast ("ArgsSchema" , _MockSchemaV1 ))
210216 def tool_func_v1 (* , arg1 : int , arg2 : bool , arg3 : dict | None = None ) -> str :
211217 return f"{ arg1 } { arg2 } { arg3 } "
@@ -348,6 +354,9 @@ def structured_tool(
348354 assert result == expected
349355
350356
357+ @pytest .mark .skipif (
358+ sys .version_info >= (3 , 14 ), reason = "Pydantic v1 not supported with Python 3.14+"
359+ )
351360def test_structured_tool_types_parsed_pydantic_v1 () -> None :
352361 """Test the non-primitive types are correctly passed to structured tools."""
353362
@@ -1880,7 +1889,10 @@ class FooV1Namespace(BaseModelV1):
18801889# behave well with either pydantic 1 proper,
18811890# pydantic v1 from pydantic 2,
18821891# or pydantic 2 proper.
1883- TEST_MODELS = generate_models () + generate_backwards_compatible_v1 ()
1892+ TEST_MODELS = generate_models ()
1893+
1894+ if sys .version_info < (3 , 14 ):
1895+ TEST_MODELS += generate_backwards_compatible_v1 ()
18841896
18851897
18861898@pytest .mark .parametrize ("pydantic_model" , TEST_MODELS )
@@ -2079,6 +2091,8 @@ def test__get_all_basemodel_annotations_v2(*, use_v1_namespace: bool) -> None:
20792091 A = TypeVar ("A" )
20802092
20812093 if use_v1_namespace :
2094+ if sys .version_info >= (3 , 14 ):
2095+ pytest .skip ("Pydantic v1 is not supported with Python 3.14+" )
20822096
20832097 class ModelA (BaseModelV1 , Generic [A ], extra = "allow" ):
20842098 a : A
0 commit comments