We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 68d4c33 commit f344107Copy full SHA for f344107
vllm/entrypoints/chat_utils.py
@@ -1095,7 +1095,11 @@ def _parse_chat_message_content(
1095
if role == 'assistant':
1096
parsed_msg = _AssistantParser(message)
1097
1098
- if "tool_calls" in parsed_msg:
+ # The 'tool_calls' is not None check ensures compatibility.
1099
+ # It's needed only if downstream code doesn't strictly
1100
+ # follow the OpenAI spec.
1101
+ if ("tool_calls" in parsed_msg
1102
+ and parsed_msg["tool_calls"] is not None):
1103
result_msg["tool_calls"] = list(parsed_msg["tool_calls"])
1104
elif role == "tool":
1105
parsed_msg = _ToolParser(message)
0 commit comments