diff --git a/common/common.cpp b/common/common.cpp index 6dea8e3d2..fa04d8a69 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -1855,10 +1855,10 @@ std::string common_chat_format_single( std::string common_chat_format_example(const common_chat_template & tmpl, bool use_jinja) { std::vector msgs = { - {"system", "You are a helpful assistant"}, - {"user", "Hello"}, - {"assistant", "Hi there"}, - {"user", "How are you?"}, + {"system", "You are a helpful assistant", {}}, + {"user", "Hello", {}}, + {"assistant", "Hi there", {}}, + {"user", "How are you?", {}}, }; return common_chat_apply_template(tmpl, msgs, true, use_jinja); } diff --git a/tests/test-chat-template.cpp b/tests/test-chat-template.cpp index 190643136..4563f9dcb 100644 --- a/tests/test-chat-template.cpp +++ b/tests/test-chat-template.cpp @@ -328,7 +328,7 @@ int main(void) { // test llama_chat_format_single for system message printf("\n\n=== llama_chat_format_single (system message) ===\n\n"); std::vector chat2; - common_chat_msg sys_msg{"system", "You are a helpful assistant"}; + common_chat_msg sys_msg{"system", "You are a helpful assistant", {}}; auto fmt_sys = [&](std::string tmpl_str) { minja::chat_template tmpl(tmpl_str, "", ""); @@ -352,10 +352,10 @@ int main(void) { // test llama_chat_format_single for user message printf("\n\n=== llama_chat_format_single (user message) ===\n\n"); - chat2.push_back({"system", "You are a helpful assistant"}); - chat2.push_back({"user", "Hello"}); - chat2.push_back({"assistant", "I am assistant"}); - common_chat_msg new_msg{"user", "How are you"}; + chat2.push_back({"system", "You are a helpful assistant", {}}); + chat2.push_back({"user", "Hello", {}}); + chat2.push_back({"assistant", "I am assistant", {}}); + common_chat_msg new_msg{"user", "How are you", {}}; auto fmt_single = [&](std::string tmpl_str) { minja::chat_template tmpl(tmpl_str, "", "");