Unverified Commit 1c7bcc55 authored by Quentin Gallouédec's avatar Quentin Gallouédec Committed by GitHub
Browse files
parent a9705a29
......@@ -1437,6 +1437,7 @@ def _postprocess_messages(messages: list[ConversationMessage]) -> None:
for item in message["tool_calls"]:
# if arguments is None or empty string, set to {}
if content := item["function"].get("arguments"):
if not isinstance(content, (dict, list)):
item["function"]["arguments"] = json.loads(content)
else:
item["function"]["arguments"] = {}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment