MCPcopy Create free account
hub / github.com/antirez/llama.cpp-deepseek-v4-flash / common_chat_format_example

Function common_chat_format_example

common/chat.cpp:510–529  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

508}
509
510std::string common_chat_format_example(const struct common_chat_templates * tmpls,
511 bool use_jinja,
512 const std::map<std::string, std::string> & chat_template_kwargs) {
513 common_chat_templates_inputs inputs;
514 inputs.use_jinja = use_jinja;
515 inputs.add_bos = tmpls->add_bos;
516 inputs.add_eos = tmpls->add_eos;
517 inputs.chat_template_kwargs = chat_template_kwargs;
518 auto add_simple_msg = [&](auto role, auto content) {
519 common_chat_msg msg;
520 msg.role = role;
521 msg.content = content;
522 inputs.messages.push_back(msg);
523 };
524 add_simple_msg("system", "You are a helpful assistant");
525 add_simple_msg("user", "Hello");
526 add_simple_msg("assistant", "Hi there");
527 add_simple_msg("user", "How are you?");
528 return common_chat_templates_apply(tmpls, inputs).prompt;
529}
530
531#define CHATML_TEMPLATE_SRC \
532 "{%- for message in messages -%}\n" \

Callers 3

mainFunction · 0.85
mtmd_cli_contextMethod · 0.85
initMethod · 0.85

Calls 2

push_backMethod · 0.45

Tested by

no test coverage detected