@@ -86,7 +86,6 @@ def test_extra_body_fields(self) -> None:
8686 params = _make_params (
8787 max_infer_iters = 5 ,
8888 max_tool_calls = 10 ,
89- tools = [{"type" : "function" , "name" : "test-function" , "parameters" : {}}],
9089 )
9190 settings = _model_settings_from_responses_params (params )
9291
@@ -95,9 +94,16 @@ def test_extra_body_fields(self) -> None:
9594 assert settings ["extra_body" ]["max_infer_iters" ] == 5
9695 assert settings ["extra_body" ]["max_tool_calls" ] == 10
9796 assert settings ["extra_body" ]["conversation" ] == "conv-1"
98- assert settings ["extra_body" ]["tools" ] == [
99- {"type" : "function" , "name" : "test-function" , "parameters" : {}}
100- ]
97+
98+ def test_tools_maps_to_openai_native_tools (self ) -> None :
99+ """Test that tools maps to openai_native_tools, not extra_body."""
100+ tools = [{"type" : "function" , "name" : "test-function" , "parameters" : {}}]
101+ params = _make_params (tools = tools )
102+ settings = _model_settings_from_responses_params (params )
103+
104+ assert "openai_native_tools" in settings
105+ assert settings ["openai_native_tools" ] is params .tools
106+ assert "tools" not in settings .get ("extra_body" , {})
101107
102108 def test_none_fields_excluded (self ) -> None :
103109 """Test that None optional fields do not appear in the result."""
@@ -581,7 +587,6 @@ def test_contains_expected_fields(self) -> None:
581587 expected = {
582588 "conversation" ,
583589 "max_infer_iters" ,
584- "tools" ,
585590 "tool_choice" ,
586591 "include" ,
587592 "text" ,
0 commit comments