char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
acecd5603
char/aliceai-t5-moe
1#pragma once 2 3#include "json-schema.h" 4#include "json.h" 5 6#include <functional> 7#include <string> 8 9std ::string json_schema_to_grammar (const common_json & schema ,bool force_gbnf = false); 10std ::string json_schema_to_grammar (const common_chat_schema_document & schema ); 11 12struct common_grammar_builder { 13std ::function < std ::string (const std ::string & , const std::string & ) > add_rule; 14std :: function < std :: string (const std::string & , const common_chat_schema & ) > add_schema; 15}; 16 17struct common_grammar_options { 18bool dotall = false; 19}; 20 21std :: string gbnf_format_literal( const std ::string & literal); 22 23std :: string build_grammar( const std ::function < void (const common_grammar_builder & ) > & cb, const common_grammar_options & options = {});