mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-04 20:28:10 +00:00
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.
This commit is contained in:
parent
11fda490ca
commit
bbc98a234d
@ -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…
Reference in New Issue
Block a user