mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-12 16:46:00 +08:00
[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>
This commit is contained in:
parent
a9705a290a
commit
1c7bcc55b8
@ -1437,6 +1437,7 @@ def _postprocess_messages(messages: list[ConversationMessage]) -> None:
|
|||||||
for item in message["tool_calls"]:
|
for item in message["tool_calls"]:
|
||||||
# if arguments is None or empty string, set to {}
|
# if arguments is None or empty string, set to {}
|
||||||
if content := item["function"].get("arguments"):
|
if content := item["function"].get("arguments"):
|
||||||
|
if not isinstance(content, (dict, list)):
|
||||||
item["function"]["arguments"] = json.loads(content)
|
item["function"]["arguments"] = json.loads(content)
|
||||||
else:
|
else:
|
||||||
item["function"]["arguments"] = {}
|
item["function"]["arguments"] = {}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user