server : fix assistant prefilling when content is an array (#14360)

This commit is contained in:
Sigbjørn Skjæret
2025-07-05 09:17:14 +02:00
committed by GitHub
parent 6681688146
commit ddef99522d
2 changed files with 30 additions and 1 deletions

View File

@ -792,7 +792,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_parts.empty()) {
for (auto & p : last_message.content_parts) {
chat_params.prompt += p.text;
}
} else {
chat_params.prompt += last_message.content;
}
}
llama_params["chat_format"] = static_cast<int>(chat_params.format);