[Bugfix][Frontend] Build tool-call grammars from the tools the prompt renders (#59879)

Signed-off-by: Rongjie Jiang <j1870831863@outlook.com>
Signed-off-by: sfeng33 <4florafeng@gmail.com>
Co-authored-by: Flora Feng <4florafeng@gmail.com>
This commit is contained in:
RomeJay
2026-10-05 22:01:03 +00:00
committed by GitHub
co-authored by Flora Feng
parent 3fb1cd796b
commit 2e06395fd3
6 changed files with 247 additions and 43 deletions
+6 -1
View File
@@ -50,6 +50,7 @@ from vllm.tool_parsers.streaming import (
extract_required_tool_call_streaming,
)
from vllm.tool_parsers.structural_tag_registry import (
get_structural_tag_tools,
limit_to_single_tool_call,
resolve_tool_strictness,
)
@@ -520,7 +521,11 @@ class DelegatingParser(Parser):
resolved_tools = None
if tool_parser.structural_tag_model is not None:
resolved_tools = resolve_tool_strictness(
request.tools,
get_structural_tag_tools(
tool_parser.structural_tag_model,
request.tools,
request.tool_choice,
),
request.tool_choice,
strict_level,
)