@@ -64,7 +64,10 @@ async def test_get_all_function_tools():
64
64
65
65
for idx , tool in enumerate (tools ):
66
66
assert isinstance (tool , FunctionTool )
67
- assert tool .params_json_schema == schemas [idx ]
67
+ if schemas [idx ] == {}:
68
+ assert tool .params_json_schema == snapshot ({"properties" : {}})
69
+ else :
70
+ assert tool .params_json_schema == schemas [idx ]
68
71
assert tool .name == names [idx ]
69
72
70
73
# Also make sure it works with strict schemas
@@ -168,10 +171,7 @@ async def test_agent_convert_schemas_true():
168
171
169
172
# Checks that additionalProperties is set to False
170
173
assert bar_tool .params_json_schema == snapshot (
171
- {
172
- "type" : "object" ,
173
- "additionalProperties" : {"type" : "string" },
174
- }
174
+ {"type" : "object" , "additionalProperties" : {"type" : "string" }, "properties" : {}}
175
175
)
176
176
assert bar_tool .strict_json_schema is False , "bar_tool should not be strict"
177
177
@@ -221,7 +221,9 @@ async def test_agent_convert_schemas_false():
221
221
assert foo_tool .params_json_schema == strict_schema
222
222
assert foo_tool .strict_json_schema is False , "Shouldn't be converted unless specified"
223
223
224
- assert bar_tool .params_json_schema == non_strict_schema
224
+ assert bar_tool .params_json_schema == snapshot (
225
+ {"type" : "object" , "additionalProperties" : {"type" : "string" }, "properties" : {}}
226
+ )
225
227
assert bar_tool .strict_json_schema is False
226
228
227
229
assert baz_tool .params_json_schema == possible_to_convert_schema
@@ -256,7 +258,9 @@ async def test_agent_convert_schemas_unset():
256
258
assert foo_tool .params_json_schema == strict_schema
257
259
assert foo_tool .strict_json_schema is False , "Shouldn't be converted unless specified"
258
260
259
- assert bar_tool .params_json_schema == non_strict_schema
261
+ assert bar_tool .params_json_schema == snapshot (
262
+ {"type" : "object" , "additionalProperties" : {"type" : "string" }, "properties" : {}}
263
+ )
260
264
assert bar_tool .strict_json_schema is False
261
265
262
266
assert baz_tool .params_json_schema == possible_to_convert_schema
0 commit comments