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

Function build_grammar

smallthinker/tests/test-chat.cpp:111–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111static std::unique_ptr<llama_grammar> build_grammar(const std::string & grammar_str) {
112 return std::unique_ptr<llama_grammar>(
113 llama_grammar_init_impl(nullptr, grammar_str.c_str(), "root", false, nullptr, 0, nullptr, 0));
114}
115
116// TODO: extract to common helper (copied from test-grammar-integration.cpp)
117static bool match_string(const std::string & input, llama_grammar * grammar) {

Callers 1

test_templatesFunction · 0.70

Calls 2

llama_grammar_init_implFunction · 0.85
c_strMethod · 0.45

Tested by

no test coverage detected