From c9e5799bd12fd5fefb0fb375ac537a6b7d53892e Mon Sep 17 00:00:00 2001 From: Chang Su Date: Thu, 13 Nov 2025 13:47:24 -0800 Subject: [PATCH] [router][grpc] Refine docs in minimax_m2 to match other parsers (#13218) --- .../src/tool_parser/parsers/minimax_m2.rs | 30 +++++-------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/sgl-router/src/tool_parser/parsers/minimax_m2.rs b/sgl-router/src/tool_parser/parsers/minimax_m2.rs index eff92ba67..1fb19c41b 100644 --- a/sgl-router/src/tool_parser/parsers/minimax_m2.rs +++ b/sgl-router/src/tool_parser/parsers/minimax_m2.rs @@ -16,30 +16,16 @@ use crate::{ /// MiniMax M2 format parser for tool calls /// -/// Implements the MiniMax-M2 model's XML-based tool calling format as specified in the -/// official chat template. The M2 model uses a structured XML format for function invocations -/// to ensure reliable parsing and execution. +/// Handles the MiniMax M2 specific format: +/// `value` /// -/// ## Format Reference -/// - HuggingFace Model: https://huggingface.co/MiniMaxAI/MiniMax-M2 -/// - Chat Template: https://huggingface.co/MiniMaxAI/MiniMax-M2?chat_template=default +/// Features: +/// - Namespaced XML tags (`minimax:tool_call`) +/// - Function wrapped in `` tags +/// - Parameters as `value` +/// - Incremental JSON streaming for parameters /// -/// ## Tool Call Structure -/// ```xml -/// -/// -/// value1 -/// value2 -/// -/// -/// ``` -/// -/// ## Key Features -/// - **Namespaced XML tags**: Uses `minimax:` namespace to avoid conflicts -/// - **Structured invocation**: Functions wrapped in `` tags -/// - **Named parameters**: Each parameter uses `value` -/// - **Incremental streaming**: Converts XML to JSON progressively during streaming -/// - **XML entity decoding**: Handles encoded entities (`<`, `>`, etc.) in parameter values +/// Reference: https://huggingface.co/MiniMaxAI/MiniMax-M2?chat_template=default pub struct MinimaxM2Parser { // Regex patterns tool_call_extractor: Regex,