chat: harden caps check (#24973)

This commit is contained in:
Piotr Wilkin (ilintar)
2026-06-25 02:49:22 +02:00
committed by GitHub
parent 8be759e6f7
commit 09cedfd699
2 changed files with 9 additions and 1 deletions
+4
View File
@@ -2758,5 +2758,9 @@ common_chat_msg common_chat_peg_parse(const common_peg_arena & src_pars
std::map<std::string, bool> common_chat_templates_get_caps(const common_chat_templates * chat_templates) {
GGML_ASSERT(chat_templates != nullptr);
GGML_ASSERT(chat_templates->template_default != nullptr);
if (chat_templates->template_tool_use != nullptr) {
// take the more expressive template when available
return chat_templates->template_tool_use->caps.to_map();
}
return chat_templates->template_default->caps.to_map();
}