Make tool call json decode error recoverable (#8233)

This commit is contained in:
Boxuan Li
2025-05-03 23:01:32 +08:00
committed by GitHub
parent de175dcc87
commit 98cb2e24ee
3 changed files with 3 additions and 3 deletions

View File

@@ -76,7 +76,7 @@ def response_to_actions(
try:
arguments = json.loads(tool_call.function.arguments)
except json.decoder.JSONDecodeError as e:
raise RuntimeError(
raise FunctionCallValidationError(
f'Failed to parse tool call arguments: {tool_call.function.arguments}'
) from e