[Bugfix] Catch errors when DeepSeek-V3.2 generates malformed JSON (#18174)

This commit is contained in:
Muqi Li
2026-03-03 16:10:07 +08:00
committed by GitHub
parent 7a2d3df96f
commit 6af0448cc9

View File

@@ -158,9 +158,12 @@ class DeepSeekV32Detector(BaseFormatDetector):
if partial_match.group(2) == "true":
parameters[param_name] = param_value.strip()
else:
parameters[param_name] = _partial_json_loads(
param_value, Allow.ALL
)[0]
try:
parameters[param_name] = _partial_json_loads(
param_value, Allow.ALL
)[0]
except json.JSONDecodeError:
parameters[param_name] = param_value.strip()
return parameters