[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:
co-authored by
mosya415
Ben Browning
parent
877dae9c68
commit
11d291511a
@@ -360,7 +360,7 @@ def _parse_function_block(
|
||||
if not key:
|
||||
has_invalid_param = True
|
||||
break
|
||||
val_text = (param.text or "").strip()
|
||||
val_text = param.text or ""
|
||||
if not _add_argument(
|
||||
func_name or "",
|
||||
key,
|
||||
@@ -392,7 +392,8 @@ def _parse_function_block(
|
||||
val_text = pm.group(2) or ""
|
||||
if val_text.startswith("<![CDATA[") and val_text.endswith("]]>"):
|
||||
val_text = val_text[len("<![CDATA[") : -len("]]>")]
|
||||
val_text = val_text.strip()
|
||||
else:
|
||||
val_text = val_text.strip()
|
||||
if not _add_argument(
|
||||
func_name or "",
|
||||
key,
|
||||
@@ -445,7 +446,8 @@ def _parse_partial_params(
|
||||
val_text = pm.group(2) or ""
|
||||
if val_text.startswith("<![CDATA[") and val_text.endswith("]]>"):
|
||||
val_text = val_text[len("<![CDATA[") : -len("]]>")]
|
||||
val_text = val_text.strip()
|
||||
else:
|
||||
val_text = val_text.strip()
|
||||
_add_argument(
|
||||
func_name,
|
||||
key,
|
||||
|
||||
Reference in New Issue
Block a user