Skip to content

Commit 1c7bcc5

Browse files
[Frontend] Allow parsed tool arguments (#28820)
Signed-off-by: Quentin Gallouédec <45557362+qgallouedec@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent a9705a2 commit 1c7bcc5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

vllm/entrypoints/chat_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1437,7 +1437,8 @@ def _postprocess_messages(messages: list[ConversationMessage]) -> None:
14371437
for item in message["tool_calls"]:
14381438
# if arguments is None or empty string, set to {}
14391439
if content := item["function"].get("arguments"):
1440-
item["function"]["arguments"] = json.loads(content)
1440+
if not isinstance(content, (dict, list)):
1441+
item["function"]["arguments"] = json.loads(content)
14411442
else:
14421443
item["function"]["arguments"] = {}
14431444

0 commit comments

Comments
 (0)