[Bugfix] Fix Apertus streaming scientific notation (#61812)

Signed-off-by: bzsuni <bingzhe.sun@daocloud.io>
Co-authored-by: Flora Feng <4florafeng@gmail.com>
This commit is contained in:
bzsuni
2026-10-15 16:49:57 +00:00
committed by GitHub
co-authored by Flora Feng
parent 957d512e96
commit 338dab077c
2 changed files with 19 additions and 1 deletions
+3 -1
View File
@@ -417,7 +417,9 @@ class ApertusToolParser(ToolParser):
"""
try:
parsed, _ = partial_json_loads(json_str, Allow.ALL)
# An exponent can change a number's already-streamed representation.
flags = Allow.ALL if is_final else Allow.ALL & ~Allow.NUM
parsed, _ = partial_json_loads(json_str, flags)
if not isinstance(parsed, list):
parsed = [parsed] if parsed else []
except Exception: