pub unsafe extern "C" fn llama_sampler_init_grammar_lazy_patterns(
vocab: *const llama_vocab,
grammar_str: *const c_char,
grammar_root: *const c_char,
trigger_patterns: *mut *const c_char,
num_trigger_patterns: usize,
trigger_tokens: *const llama_token,
num_trigger_tokens: usize,
) -> *mut llama_sampler
Expand description
@details Lazy grammar sampler, introduced in https://github.com/ggml-org/llama.cpp/pull/9639 @param trigger_patterns A list of patterns that will trigger the grammar sampler. Pattern will be matched from the start of the generation output, and grammar sampler will be fed content starting from its first match group. @param trigger_tokens A list of tokens that will trigger the grammar sampler. Grammar sampler will be fed content starting from the trigger token included.