Skip to content

Commit 23b9e59

Browse files
committed
use llguidance for json schemas
1 parent 3fb701d commit 23b9e59

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

common/json-schema-to-grammar.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,10 +1036,14 @@ class SchemaConverter {
10361036
};
10371037

10381038
std::string json_schema_to_grammar(const json & schema) {
1039+
#ifdef GGML_LLGUIDANCE
1040+
return "llg:json:" + schema.dump();
1041+
#else
10391042
SchemaConverter converter([](const std::string &) { return json::object(); }, /* dotall= */ false);
10401043
auto copy = schema;
10411044
converter.resolve_refs(copy, "input");
10421045
converter.visit(copy, "");
10431046
converter.check_errors();
10441047
return converter.format_grammar();
1048+
#endif
10451049
}

0 commit comments

Comments
 (0)