Skip to content

Commit

Permalink
Update parser (#14831)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hinthornw committed Dec 18, 2023
1 parent 11fda49 commit bbc98a2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down

0 comments on commit bbc98a2

Please sign in to comment.