| 1 | # SPDX-License-Identifier: Apache-2.0 |
| 2 | # SPDX-FileCopyrightText: Copyright contributors to the vLLM project |
| 3 | |
| 4 | from vllm.tool_parsers.rust_tool_parser import RustToolParser |
| 5 | |
| 6 | |
| 7 | class MinimaxM3ToolParser(RustToolParser): |
| 8 | """Adapter from the Rust MiniMax M3 parser to vLLM ToolParser. |
| 9 | |
| 10 | The real M3 grammar lives in the Rust tool-parser crate. This class only |
| 11 | configures the generic Rust bridge with the MiniMax M3 parser name. |
| 12 | |
| 13 | M3 is not M2 with renamed tags: it prefixes each structural tag with the |
| 14 | MiniMax namespace marker, allows multiple ``<invoke>`` tags in one wrapper, |
| 15 | and represents nested arguments with parameter-name XML tags. |
| 16 | """ |
| 17 | |
| 18 | rust_parser_name = "MinimaxM3ToolParser" |
| 19 | tool_call_start_token = "]<]minimax[>[<tool_call>" |