Update parser (#14831)

Gpt-3.5 sometimes calls with empty string arguments instead of `{}`

I'd assume it's because the typescript representation on their backend
makes it a bit ambiguous.
pull/14492/head^2
William FH 6 months ago committed by GitHub
parent 11fda490ca
commit bbc98a234d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -36,7 +36,7 @@ def parse_ai_message_to_openai_tool_action(
function = tool_call["function"]
function_name = function["name"]
try:
_tool_input = json.loads(function["arguments"])
_tool_input = json.loads(function["arguments"] or "{}")
except JSONDecodeError:
raise OutputParserException(
f"Could not parse tool input: {function} because "

Loading…
Cancel
Save