[Refactor][Parser] Unify Response API to use parser.parse() like Chat Completion API (#45190)

Signed-off-by: sfeng33 <4florafeng@gmail.com>
This commit is contained in:
Flora Feng
2026-06-11 04:37:51 +00:00
committed by GitHub
parent f272dfdce1
commit 3a04061701
6 changed files with 101 additions and 211 deletions
@@ -3,8 +3,8 @@
"""Unit tests for ResponsesParser with the unified Parser interface.
These tests verify that ResponsesParser correctly delegates to the unified
Parser (via extract_response_outputs) instead of calling separate
ReasoningParser / ToolParser instances directly.
Parser (via parse) instead of calling separate ReasoningParser / ToolParser
instances directly.
"""
from collections.abc import Sequence
@@ -78,9 +78,9 @@ def test_responses_parser_allows_named_tool_choice_with_none_content():
)
parser = _DummyDelegatingParser(tokenizer=None)
tool_calls, content = parser._parse_tool_calls(
request=request,
tool_calls, content = parser._extract_tool_calls(
content=None,
request=request,
enable_auto_tools=False,
)