llama: parse JSON schema using nlohmann::ordered_json to maintain ordering (#8071)

This commit is contained in:
Pascal Patry 2024-12-12 12:57:28 -05:00 committed by GitHub
parent 18f6a98bd6
commit c216850523
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -49,7 +49,7 @@ int schema_to_grammar(const char *json_schema, char *grammar, size_t max_len)
{
try
{
nlohmann::json schema = nlohmann::json::parse(json_schema);
nlohmann::ordered_json schema = nlohmann::ordered_json::parse(json_schema);
std::string grammar_str = json_schema_to_grammar(schema);
size_t len = grammar_str.length();
if (len >= max_len)