| 464 | } |
| 465 | |
| 466 | std::string common_chat_format_example(const struct common_chat_templates * tmpls, bool use_jinja) { |
| 467 | common_chat_templates_inputs inputs; |
| 468 | inputs.use_jinja = use_jinja; |
| 469 | auto add_simple_msg = [&](auto role, auto content) { |
| 470 | common_chat_msg msg; |
| 471 | msg.role = role; |
| 472 | msg.content = content; |
| 473 | inputs.messages.push_back(msg); |
| 474 | }; |
| 475 | add_simple_msg("system", "You are a helpful assistant"); |
| 476 | add_simple_msg("user", "Hello"); |
| 477 | add_simple_msg("assistant", "Hi there"); |
| 478 | add_simple_msg("user", "How are you?"); |
| 479 | return common_chat_templates_apply(tmpls, inputs).prompt; |
| 480 | } |
| 481 | |
| 482 | #define CHATML_TEMPLATE_SRC \ |
| 483 | "{%- for message in messages -%}\n" \ |
no test coverage detected