llama-cpp-bindings-sys 0.34.0

Low level bindings to llama.cpp
Documentation
#pragma once

#ifdef __cplusplus
extern "C" {
#endif

struct llama_vocab;

typedef enum llama_rs_gbnf_validation_status {
    LLAMA_RS_GBNF_VALIDATION_OK = 0,
    LLAMA_RS_GBNF_VALIDATION_SYNTAX_ERROR,
    LLAMA_RS_GBNF_VALIDATION_EMPTY_RULE_SET,
    LLAMA_RS_GBNF_VALIDATION_ROOT_SYMBOL_MISSING,
    LLAMA_RS_GBNF_VALIDATION_UNSUPPORTED_GRAMMAR,
    LLAMA_RS_GBNF_VALIDATION_ERROR_STRING_ALLOCATION_FAILED,
    LLAMA_RS_GBNF_VALIDATION_LLAMA_CPP_OUT_OF_MEMORY,
    LLAMA_RS_GBNF_VALIDATION_THREW_CXX_EXCEPTION,
} llama_rs_gbnf_validation_status;

llama_rs_gbnf_validation_status llama_rs_validate_gbnf(
    const struct llama_vocab * vocab,
    const char * grammar_str,
    const char * grammar_root,
    char ** out_error);

#ifdef __cplusplus
}
#endif