@@ -152,9 +152,13 @@ def optional_param_function(a: int, b: Optional[int] = None) -> str:
152152
153153
154154@pytest .mark .asyncio
155- async def test_optional_param_function ():
155+ async def test_non_strict_mode_function ():
156156 tool = optional_param_function
157157
158+ assert tool .strict_json_schema is False , "strict_json_schema should be False"
159+
160+ assert tool .params_json_schema .get ("required" ) == ["a" ], "required should only be a"
161+
158162 input_data = {"a" : 5 }
159163 output = await tool .on_invoke_tool (ctx_wrapper (), json .dumps (input_data ))
160164 assert output == "5_no_b"
@@ -165,7 +169,7 @@ async def test_optional_param_function():
165169
166170
167171@function_tool (strict_mode = False )
168- def multiple_optional_params_function (
172+ def all_optional_params_function (
169173 x : int = 42 ,
170174 y : str = "hello" ,
171175 z : Optional [int ] = None ,
@@ -176,8 +180,12 @@ def multiple_optional_params_function(
176180
177181
178182@pytest .mark .asyncio
179- async def test_multiple_optional_params_function ():
180- tool = multiple_optional_params_function
183+ async def test_all_optional_params_function ():
184+ tool = all_optional_params_function
185+
186+ assert tool .strict_json_schema is False , "strict_json_schema should be False"
187+
188+ assert tool .params_json_schema .get ("required" ) is None , "required should be empty"
181189
182190 input_data : dict [str , Any ] = {}
183191 output = await tool .on_invoke_tool (ctx_wrapper (), json .dumps (input_data ))
0 commit comments