fix: MiniMax tool call normalization and thinking block handling (#458)

Co-authored-by: 0xallam <ahmed39652003@gmail.com>
This commit is contained in:
Dr Alex Mitre
2026-05-03 17:12:37 -06:00
committed by GitHub
parent 6da7315aa3
commit a75ad2960e
2 changed files with 26 additions and 4 deletions
+6 -1
View File
@@ -20,7 +20,12 @@ def normalize_tool_format(content: str) -> str:
<function="X"> → <function=X>
<parameter="X"> → <parameter=X>
"""
if "<invoke" in content or "<function_calls" in content:
if (
"<invoke" in content
or "<function_calls" in content
or '<parameter name="' in content
or "<parameter name='" in content
):
content = _FUNCTION_CALLS_TAG.sub("", content)
content = _INVOKE_OPEN.sub(r"<function=\1>", content)
content = _PARAM_NAME_ATTR.sub(r"<parameter=\1>", content)