[BugFix] Support custom tool parsers when tool_choice is required and named function (#39870)

Signed-off-by: JaredforReal <w13431838023@gmail.com>
Signed-off-by: sfeng33 <4florafeng@gmail.com>
Co-authored-by: sfeng33 <4florafeng@gmail.com>
This commit is contained in:
Jared Wen
2026-04-17 16:38:10 +00:00
committed by GitHub
co-authored by sfeng33
parent 747256bb5d
commit ceade1952c
5 changed files with 100 additions and 12 deletions
@@ -23,6 +23,8 @@ logger = init_logger(__name__)
class Glm47MoeModelToolParser(Glm4MoeModelToolParser):
supports_required_and_named = False
def __init__(self, tokenizer: TokenizerLike, tools: list[Tool] | None = None):
super().__init__(tokenizer, tools)
# GLM-4.7 format: <tool_call>func_name[<arg_key>...]*</tool_call>