@@ -612,25 +612,33 @@ def test_binary_content_validation_with_optional_identifier():
612612
613613
614614def test_model_request_tool_tracking_excluded_from_serialization ():
615- """Test that function_tools and builtin_tools are not serialized in the request."""
615+ """Test that function, builtin, and output tools are not serialized in the request."""
616616 tool_def = ToolDefinition (
617617 name = 'test_tool' ,
618618 description = 'A test tool' ,
619619 parameters_json_schema = {'type' : 'object' , 'properties' : {}},
620620 )
621+ output_tool_def = ToolDefinition (
622+ name = 'request_output' ,
623+ description = 'An output tool' ,
624+ parameters_json_schema = {'type' : 'object' , 'properties' : {}},
625+ )
621626
622627 request = ModelRequest (
623628 parts = [UserPromptPart ('test prompt' )],
624629 instructions = 'test instructions' ,
625630 function_tools = [tool_def ],
626631 builtin_tools = [ImageGenerationTool ()],
632+ output_tools = [output_tool_def ],
627633 )
628634
629635 # Verify the fields are accessible
630636 assert request .function_tools == [tool_def ]
631637 assert request .builtin_tools == [ImageGenerationTool ()]
638+ assert request .output_tools == [output_tool_def ]
632639
633640 # Serialize - fields ARE excluded
634641 serialized = ModelMessagesTypeAdapter .dump_python ([request ], mode = 'json' )
635642 assert 'function_tools' not in serialized [0 ]
636643 assert 'builtin_tools' not in serialized [0 ]
644+ assert 'output_tools' not in serialized [0 ]
0 commit comments