Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions vllm/entrypoints/chat_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1450,9 +1450,13 @@
and isinstance(message["tool_calls"], list)
):
for item in message["tool_calls"]:
item["function"]["arguments"] = json.loads(
item["function"]["arguments"]
)
arguments = item["function"]["arguments"]
function_name = item["function"]["name"]
try:
item["function"]["arguments"] = json.loads(arguments)
except json.JSONDecodeError as e:
logger.exception("Failed to decode JSON for function '%s'. Arguments: %s", function_name, arguments)

Check failure on line 1458 in vllm/entrypoints/chat_utils.py

View workflow job for this annotation

GitHub Actions / pre-commit

Ruff (E501)

vllm/entrypoints/chat_utils.py:1458:81: E501 Line too long (120 > 80)
raise ValueError(f"Invalid JSON arguments for function '{function_name}'") from e

Check failure on line 1459 in vllm/entrypoints/chat_utils.py

View workflow job for this annotation

GitHub Actions / pre-commit

Ruff (E501)

vllm/entrypoints/chat_utils.py:1459:81: E501 Line too long (101 > 80)


def parse_chat_messages(
Expand Down
Loading