Fix Jinja2 template error in Vulkan backend - ensure all messages have content attribute

parent e7e2c626
......@@ -1723,8 +1723,8 @@ async def chat_completions(request: ChatCompletionRequest):
messages_dict = []
for msg in messages:
msg_dict = {"role": msg.role}
if msg.content:
msg_dict["content"] = msg.content
# Always include content key - llama_cpp template expects it
msg_dict["content"] = msg.content if msg.content is not None else ""
if msg.tool_calls:
msg_dict["tool_calls"] = msg.tool_calls
if msg.name:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment