@@ -358,8 +358,14 @@ def y_tool(y: str) -> None:
358
358
agent = Agent ('test' , tools = [Tool (x_tool , function_schema = y_fs )])
359
359
360
360
# make sure the function schema for y_tool is used instead of the default of x_tool.
361
- assert 'x' not in agent ._function_tools ['x_tool' ]._parameters_json_schema ['properties' ]
362
- assert 'y' in agent ._function_tools ['x_tool' ]._parameters_json_schema ['properties' ]
361
+ assert agent ._function_tools ['x_tool' ]._parameters_json_schema == snapshot (
362
+ {
363
+ 'additionalProperties' : False ,
364
+ 'properties' : {'y' : {'title' : 'Y' , 'type' : 'string' }},
365
+ 'required' : ['y' ],
366
+ 'type' : 'object' ,
367
+ }
368
+ )
363
369
364
370
365
371
def test_init_tool_ctx_with_function_schema ():
@@ -374,9 +380,14 @@ def y_tool(ctx: RunContext[int], y: str) -> None:
374
380
)
375
381
agent = Agent ('test' , tools = [Tool (x_tool , function_schema = y_fs , takes_ctx = True )], deps_type = int )
376
382
377
- # make sure the function schema for y_tool is used instead of the default of x_tool.
378
- assert 'x' not in agent ._function_tools ['x_tool' ]._parameters_json_schema ['properties' ]
379
- assert 'y' in agent ._function_tools ['x_tool' ]._parameters_json_schema ['properties' ]
383
+ assert agent ._function_tools ['x_tool' ]._parameters_json_schema == snapshot (
384
+ {
385
+ 'additionalProperties' : False ,
386
+ 'properties' : {'y' : {'title' : 'Y' , 'type' : 'string' }},
387
+ 'required' : ['y' ],
388
+ 'type' : 'object' ,
389
+ }
390
+ )
380
391
381
392
382
393
def ctx_tool (ctx : RunContext [int ], x : int ) -> int :
0 commit comments