[Parser] Migrate ResponsesParser to unified Parser interface (#42977)

Signed-off-by: Alberto Perdomo <aperdomo@redhat.com>
This commit is contained in:
alberto
2026-06-02 08:50:05 +00:00
committed by GitHub
parent d247a9dc13
commit e30313220c
4 changed files with 442 additions and 94 deletions
+4 -7
View File
@@ -460,16 +460,13 @@ class OpenAIServingResponses(OpenAIServing):
context = ParsableContext(
response_messages=messages,
tokenizer=tokenizer,
reasoning_parser_cls=self.parser.reasoning_parser_cls
if self.parser
else None,
parser_cls=self.parser,
request=request,
tool_parser_cls=self.parser.tool_parser_cls
if self.parser
else None,
available_tools=available_tools,
chat_template=self.chat_template,
chat_template_content_format=self.chat_template_content_format,
enable_auto_tools=self.enable_auto_tools,
tool_call_id_type=self.tool_call_id_type,
)
else:
context = SimpleContext()
@@ -708,7 +705,7 @@ class OpenAIServingResponses(OpenAIServing):
context.request,
context.parser.response_messages,
context.tool_dicts,
context.tool_parser_cls,
context.parser_cls.tool_parser_cls if context.parser_cls else None,
context.chat_template,
context.chat_template_content_format,
)