mirror of
https://github.com/hwchase17/langchain.git
synced 2026-05-12 17:57:22 +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:
@@ -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 "
|
||||
|
||||
Reference in New Issue
Block a user