MCPcopy Create free account
hub / github.com/FastFlowLM/FastFlowLM / apply_chat_template

Method apply_chat_template

src/common/AutoModel/modeling_qwen3.cpp:49–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49std::string Qwen3::apply_chat_template(nlohmann::ordered_json& messages, nlohmann::ordered_json tools) {
50 minja::chat_template_inputs inputs;
51 inputs.add_generation_prompt = true;
52 inputs.messages = messages;
53 inputs.extra_context = this->extra_context;
54 inputs.extra_context["enable_thinking"] = this->enable_think;
55 if (!tools.empty() && this->enable_tool)
56 inputs.tools = tools;
57 return this->chat_tmpl->apply(inputs);
58}
59
60bool Qwen3::insert(chat_meta_info_t& meta_info, lm_uniform_input_t& input, std::function<bool()> is_cancelled) {
61 // preprocess

Callers 1

insertMethod · 0.95

Calls 2

applyMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected