diff --git a/vllm/entrypoints/chat_utils.py b/vllm/entrypoints/chat_utils.py index 3b722c2d9277..03214c4d131b 100644 --- a/vllm/entrypoints/chat_utils.py +++ b/vllm/entrypoints/chat_utils.py @@ -1437,7 +1437,8 @@ 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"): - item["function"]["arguments"] = json.loads(content) + if not isinstance(content, (dict, list)): + item["function"]["arguments"] = json.loads(content) else: item["function"]["arguments"] = {}