#pragma once #include "ggml.h" // Change JSON_ASSERT from assert() to GGML_ASSERT: #define JSON_ASSERT GGML_ASSERT #include std::string json_schema_to_grammar(const nlohmann::ordered_json & schema, bool force_gbnf = false); struct common_grammar_builder { std::function add_rule; std::function add_schema; std::function resolve_refs; }; struct common_grammar_options { bool dotall = false; }; std::string gbnf_format_literal(const std::string & literal); std::string build_grammar(const std::function& cb, const common_grammar_options& options = {});