| 45 | } |
| 46 | |
| 47 | std::string LFM2::apply_chat_template(nlohmann::ordered_json& messages, nlohmann::ordered_json tools) { |
| 48 | minja::chat_template_inputs inputs; |
| 49 | minja::chat_template_options opt; |
| 50 | opt.polyfill_tool_responses = false; |
| 51 | inputs.add_generation_prompt = true; |
| 52 | inputs.messages = messages; |
| 53 | inputs.extra_context = this->extra_context; |
| 54 | // inputs.tools = tools; |
| 55 | return this->chat_tmpl->apply(inputs, opt); |
| 56 | } |
| 57 | |
| 58 | bool LFM2::insert(chat_meta_info_t& meta_info, lm_uniform_input_t& input, std::function<bool()> is_cancelled) { |
| 59 | // preprocess |