MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / common_chat_templates_source

Function common_chat_templates_source

smallthinker/common/chat.cpp:498–510  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

496}
497
498const char * common_chat_templates_source(const struct common_chat_templates * tmpls, const char * variant) {
499 if (variant != nullptr) {
500 if (strcmp(variant, "tool_use") == 0) {
501 if (tmpls->template_tool_use) {
502 return tmpls->template_tool_use->source().c_str();
503 }
504 return nullptr;
505 } else {
506 LOG_DBG("%s: unknown template variant: %s\n", __func__, variant);
507 }
508 }
509 return tmpls->template_default->source().c_str();
510}
511
512common_chat_templates_ptr common_chat_templates_init(
513 const struct llama_model * model,

Callers 1

mainFunction · 0.85

Calls 1

c_strMethod · 0.45

Tested by

no test coverage detected