[GPT-OSS] Strict tool call and constrained decoding for Harmony (#45560)

Signed-off-by: Yifan Zong <yzong@redhat.com>
This commit is contained in:
yzong-rh
2026-08-01 12:10:26 -04:00
committed by GitHub
parent 127a7cebc9
commit dc818c198d
10 changed files with 632 additions and 511 deletions
+9
View File
@@ -201,6 +201,15 @@ class OnlineRenderer:
)
else:
# For GPT-OSS.
if self.parser is not None:
# HarmonyParser doesn't need chat_template_kwargs
# TODO: Unify adjust_request() call with non-harmony branch
self.parser(
self.renderer.get_tokenizer(),
request.tools,
model_config=self.model_config,
).adjust_request(request=request)
should_include_tools = tool_dicts is not None
conversation, engine_inputs = self._make_request_with_harmony(
request, should_include_tools