@@ -89,7 +89,6 @@ def test_extra_body_fields(self) -> None:
8989 params = _make_params (
9090 max_infer_iters = 5 ,
9191 max_tool_calls = 10 ,
92- tools = [{"type" : "function" , "name" : "test-function" , "parameters" : {}}],
9392 )
9493 settings = _model_settings_from_responses_params (params )
9594
@@ -98,9 +97,16 @@ def test_extra_body_fields(self) -> None:
9897 assert settings ["extra_body" ]["max_infer_iters" ] == 5
9998 assert settings ["extra_body" ]["max_tool_calls" ] == 10
10099 assert settings ["extra_body" ]["conversation" ] == "conv-1"
101- assert settings ["extra_body" ]["tools" ] == [
102- {"type" : "function" , "name" : "test-function" , "parameters" : {}}
103- ]
100+
101+ def test_tools_maps_to_openai_native_tools (self ) -> None :
102+ """Test that tools maps to openai_native_tools, not extra_body."""
103+ tools = [{"type" : "function" , "name" : "test-function" , "parameters" : {}}]
104+ params = _make_params (tools = tools )
105+ settings = _model_settings_from_responses_params (params )
106+
107+ assert "openai_native_tools" in settings
108+ assert settings ["openai_native_tools" ] is params .tools
109+ assert "tools" not in settings .get ("extra_body" , {})
104110
105111 def test_none_fields_excluded (self ) -> None :
106112 """Test that None optional fields do not appear in the result."""
@@ -584,7 +590,6 @@ def test_contains_expected_fields(self) -> None:
584590 expected = {
585591 "conversation" ,
586592 "max_infer_iters" ,
587- "tools" ,
588593 "tool_choice" ,
589594 "include" ,
590595 "text" ,
0 commit comments