llama_sampler_init_grammar

Function llama_sampler_init_grammar 

Source
pub unsafe extern "C" fn llama_sampler_init_grammar(
    vocab: *const llama_vocab,
    grammar_str: *const c_char,
    grammar_root: *const c_char,
) -> *mut llama_sampler
Expand description

@details Intializes a GBNF grammar, see grammars/README.md for details. @param vocab The vocabulary that this grammar will be used with. @param grammar_str The production rules for the grammar, encoded as a string. Returns an empty grammar if empty. Returns NULL if parsing of grammar_str fails. @param grammar_root The name of the start symbol for the grammar.