Stabilize product data export flow

This commit is contained in:
wuyang6
2026-05-11 11:46:09 +08:00
parent 1752c81913
commit 0e2a00990f
19 changed files with 659 additions and 31 deletions
+4 -1
View File
@@ -75,8 +75,11 @@ def _parse_tool_arguments(raw_arguments: Any) -> dict[str, Any]:
try:
parsed = json.loads(raw_arguments)
except json.JSONDecodeError as exc:
preview = raw_arguments[:240].replace('\n', '\\n')
raise OpenAICompatError(
f'Invalid tool arguments returned by model: {raw_arguments!r}'
'Invalid tool arguments returned by model: '
f'line {exc.lineno} column {exc.colno}: {exc.msg}; '
f'preview={preview!r}'
) from exc
if not isinstance(parsed, dict):
raise OpenAICompatError(