MCPcopy Index your code
hub / github.com/appdevforall/CodeOnTheGo / build_grammar

Function build_grammar

subprojects/llama.cpp/tests/test-chat.cpp:116–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 5

test_templatesFunction · 0.70
test_example_nativeFunction · 0.70
test_example_qwen3_coderFunction · 0.70
test_gbnf_generationFunction · 0.50

Calls 1

llama_grammar_init_implFunction · 0.85

Tested by

no test coverage detected