1515 from_function_tool_to_tag ,
1616 no_func_reasoning_tag ,
1717 tag_with_builtin_funcs ,
18- tag_with_function_tools ,
1918)
2019
2120REASONING_MODEL_NAME = "openai/gpt-oss-120b"
@@ -410,10 +409,7 @@ def test_prepare_structured_tag_with_json_schema(self, reasoning_parser):
410409 assert len (parsed ["format" ]["tags" ]) == 2
411410
412411 # Verify analysis tag is unchanged
413- assert (
414- parsed ["format" ]["tags" ][0 ]["begin" ]
415- == "<|channel|>analysis<|message|>"
416- )
412+ assert parsed ["format" ]["tags" ][0 ]["begin" ] == "<|channel|>analysis<|message|>"
417413 assert parsed ["format" ]["tags" ][0 ]["content" ]["type" ] == "any_text"
418414
419415 # Verify final channel tag has the json_schema content constraint
@@ -531,21 +527,13 @@ def test_tool_choice_required_with_function_tools(self, reasoning_parser):
531527
532528 tag_begins = [t ["begin" ] for t in parsed ["format" ]["tags" ]]
533529 # Function tool tags present
534- assert (
535- "<|channel|>commentary to=functions.get_weather<|message|>"
536- in tag_begins
537- )
538- assert (
539- "<|channel|>analysis to=functions.get_weather<|message|>"
540- in tag_begins
541- )
530+ assert "<|channel|>commentary to=functions.get_weather<|message|>" in tag_begins
531+ assert "<|channel|>analysis to=functions.get_weather<|message|>" in tag_begins
542532 # No final
543533 assert not any ("final" in b for b in tag_begins )
544534 assert "<|channel|>final" not in parsed ["format" ]["triggers" ]
545535
546- def test_tool_choice_required_ignores_final_content_format (
547- self , reasoning_parser
548- ):
536+ def test_tool_choice_required_ignores_final_content_format (self , reasoning_parser ):
549537 """Final is blocked even when final_content_format is provided."""
550538 content_fmt = {
551539 "type" : "json_schema" ,
@@ -564,9 +552,7 @@ def test_tool_choice_required_ignores_final_content_format(
564552 tag_begins = [t ["begin" ] for t in parsed ["format" ]["tags" ]]
565553 assert not any ("final" in b for b in tag_begins )
566554
567- def test_tool_choice_auto_with_tools_and_content_format (
568- self , reasoning_parser
569- ):
555+ def test_tool_choice_auto_with_tools_and_content_format (self , reasoning_parser ):
570556 """Tool tags + final with content constraint for auto."""
571557 schema = {"type" : "object" , "properties" : {"x" : {"type" : "integer" }}}
572558 content_fmt = {"type" : "json_schema" , "json_schema" : schema }
@@ -583,10 +569,7 @@ def test_tool_choice_auto_with_tools_and_content_format(
583569
584570 tag_begins = [t ["begin" ] for t in parsed ["format" ]["tags" ]]
585571 # Function tool tags
586- assert (
587- "<|channel|>commentary to=functions.compute<|message|>"
588- in tag_begins
589- )
572+ assert "<|channel|>commentary to=functions.compute<|message|>" in tag_begins
590573 # Final tag with content constraint
591574 assert "<|channel|>final<|message|>" in tag_begins
592575 assert "<|channel|>final" in parsed ["format" ]["triggers" ]
@@ -598,9 +581,7 @@ def test_tool_choice_auto_with_tools_and_content_format(
598581 )
599582 assert final_tag ["content" ] == content_fmt
600583
601- def test_tool_choice_auto_with_tools_final_is_any_text (
602- self , reasoning_parser
603- ):
584+ def test_tool_choice_auto_with_tools_final_is_any_text (self , reasoning_parser ):
604585 """auto + function tools but no content format -> final allows free text."""
605586 fn_tools = [{"name" : "get_weather" , "parameters" : {"type" : "object" }}]
606587 result = reasoning_parser .prepare_structured_tag (
@@ -655,14 +636,8 @@ def test_mixed_builtin_and_function_tools(
655636 assert "<|channel|>commentary to=browser" in tag_begins
656637 assert "<|channel|>analysis to=browser" in tag_begins
657638 # Function tool tags
658- assert (
659- "<|channel|>commentary to=functions.get_weather<|message|>"
660- in tag_begins
661- )
662- assert (
663- "<|channel|>analysis to=functions.get_weather<|message|>"
664- in tag_begins
665- )
639+ assert "<|channel|>commentary to=functions.get_weather<|message|>" in tag_begins
640+ assert "<|channel|>analysis to=functions.get_weather<|message|>" in tag_begins
666641 # Final tag (auto + function tools)
667642 assert "<|channel|>final<|message|>" in tag_begins
668643 # General commentary trigger covers both builtin and function
@@ -684,14 +659,8 @@ def test_named_tool_choice(self, reasoning_parser):
684659
685660 tag_begins = [t ["begin" ] for t in parsed ["format" ]["tags" ]]
686661 # Only get_weather tags, not get_stock
687- assert (
688- "<|channel|>commentary to=functions.get_weather<|message|>"
689- in tag_begins
690- )
691- assert (
692- "<|channel|>analysis to=functions.get_weather<|message|>"
693- in tag_begins
694- )
662+ assert "<|channel|>commentary to=functions.get_weather<|message|>" in tag_begins
663+ assert "<|channel|>analysis to=functions.get_weather<|message|>" in tag_begins
695664 assert not any ("get_stock" in b for b in tag_begins )
696665 # No final (named tool choice blocks final)
697666 assert not any ("final" in b for b in tag_begins )
0 commit comments