[Bugfix][Tool Parser] Preserve whitespace in parameter values (MiniMax M2, Qwen3, MiniCPM5 XML) (#48846)

Signed-off-by: mosya415 <263250241+mosya415@users.noreply.github.com>
Signed-off-by: Ben Browning <56071+bbrowning@users.noreply.github.com>
Co-authored-by: mosya415 <263250241+mosya415@users.noreply.github.com>
Co-authored-by: Ben Browning <56071+bbrowning@users.noreply.github.com>
This commit is contained in:
mosya415
2026-07-17 16:45:41 +00:00
committed by GitHub
co-authored by mosya415 Ben Browning
parent 877dae9c68
commit 11d291511a
7 changed files with 164 additions and 9 deletions
+5 -2
View File
@@ -69,7 +69,9 @@ def _minimax_m2_arg_converter(raw_args: str, partial: bool) -> str:
).strip()
if not name:
continue
params[name] = match.group("value").strip()
# Keep the value verbatim (like the glm47 converter): it is inline
# between `>` and `</parameter>`, so surrounding whitespace is data.
params[name] = match.group("value")
if partial:
remaining = _PARAM_RE.sub("", raw_args)
@@ -82,7 +84,8 @@ def _minimax_m2_arg_converter(raw_args: str, partial: bool) -> str:
or ""
).strip()
if name:
params[name] = match.group("value").strip()
# Verbatim, same as the complete-match loop above.
params[name] = match.group("value")
return json.dumps(params, ensure_ascii=False)