fix assistant prefilling when content is an array

This commit is contained in:
Sigbjørn Skjæret
2025-06-24 12:01:37 +02:00
committed by GitHub
parent 1b809cee22
commit e8f8c2c711

View File

@ -779,7 +779,13 @@ static json oaicompat_chat_params_parse(
/* Append assistant prefilled message */
if (prefill_assistant_message) {
chat_params.prompt += last_message.content;
if (last_message.content.is_array()) {
for (auto & p : last_message.content) {
chat_params.prompt += p["text"];
}
} else {
chat_params.prompt += last_message.content;
}
}
llama_params["chat_format"] = static_cast<int>(chat_params.format);