| 40 | } |
| 41 | |
| 42 | std::string GPT_OSS::apply_chat_template(nlohmann::ordered_json& messages, nlohmann::ordered_json tools) { |
| 43 | minja::chat_template_inputs inputs; |
| 44 | inputs.add_generation_prompt = true; |
| 45 | inputs.messages = messages; |
| 46 | inputs.extra_context = this->extra_context; |
| 47 | inputs.extra_context["enable_thinking"] = this->enable_think; |
| 48 | inputs.extra_context["reasoning_effort"] = this->reasoning_effort; |
| 49 | inputs.extra_context["model_identity"] = this->model_identity; |
| 50 | inputs.extra_context["role"] = this->role; |
| 51 | //inputs.tools = tools; |
| 52 | |
| 53 | return this->chat_tmpl->apply(inputs); |
| 54 | } |
| 55 | json tools; |
| 56 | bool GPT_OSS::insert(chat_meta_info_t& meta_info, lm_uniform_input_t& input, std::function<bool()> is_cancelled) |
| 57 | { |