Signed-off-by: youkaichao <youkaichao@gmail.com> Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn> Signed-off-by: Bugen Zhao <i@bugenzhao.com> Signed-off-by: Jee Jee Li <pandaleefree@gmail.com> Signed-off-by: functionstackx <47992694+functionstackx@users.noreply.github.com> Signed-off-by: Yongye Zhu <zyy1102000@gmail.com> Signed-off-by: Jee Jee Li <jeejeelee@inferact.ai> Co-authored-by: OpenAI Codex <codex@openai.com> Co-authored-by: Isotr0py <mozf@mail2.sysu.edu.cn> Co-authored-by: Thien Tran <gau.nernst@yahoo.com.sg> Co-authored-by: Bugen Zhao <i@bugenzhao.com> Co-authored-by: Jee Jee Li <pandaleefree@gmail.com> Co-authored-by: Roger Wang <hey@rogerw.io> Co-authored-by: functionstackx <47992694+functionstackx@users.noreply.github.com> Co-authored-by: Yongye Zhu <zyy1102000@gmail.com> Co-authored-by: Jee Jee Li <jeejeelee@inferact.ai>
20 lines
765 B
Python
20 lines
765 B
Python
# SPDX-License-Identifier: Apache-2.0
|
|
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
|
|
|
from vllm.tool_parsers.rust_tool_parser import RustToolParser
|
|
|
|
|
|
class MinimaxM3ToolParser(RustToolParser):
|
|
"""Adapter from the Rust MiniMax M3 parser to vLLM ToolParser.
|
|
|
|
The real M3 grammar lives in the Rust tool-parser crate. This class only
|
|
configures the generic Rust bridge with the MiniMax M3 parser name.
|
|
|
|
M3 is not M2 with renamed tags: it prefixes each structural tag with the
|
|
MiniMax namespace marker, allows multiple ``<invoke>`` tags in one wrapper,
|
|
and represents nested arguments with parameter-name XML tags.
|
|
"""
|
|
|
|
rust_parser_name = "MinimaxM3ToolParser"
|
|
tool_call_start_token = "]<]minimax[>[<tool_call>"
|