Skip to content

Commit e8f8c2c

Browse files
authored
fix assistant prefilling when content is an array
1 parent 1b809ce commit e8f8c2c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tools/server/utils.hpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,13 @@ static json oaicompat_chat_params_parse(
779779

780780
/* Append assistant prefilled message */
781781
if (prefill_assistant_message) {
782-
chat_params.prompt += last_message.content;
782+
if (last_message.content.is_array()) {
783+
for (auto & p : last_message.content) {
784+
chat_params.prompt += p["text"];
785+
}
786+
} else {
787+
chat_params.prompt += last_message.content;
788+
}
783789
}
784790

785791
llama_params["chat_format"] = static_cast<int>(chat_params.format);

0 commit comments

Comments
 (0)