You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fprintf(stderr, "\n NOTE: Debug grammar file generated. To analyze this failure in detail, run the following command: ./gbnf-validator test-grammar-integration.grammar.gbnf test-grammar-integration.string.txt\n\n");
105
+
fprintf(stderr, "\n NOTE: Debug grammar file generated. To analyze this failure in detail, run the following command: ./llama-gbnf-validator test-grammar-integration.grammar.gbnf test-grammar-integration.string.txt\n\n");
R"""({"productId": 1, "productName": "A green door", "price": 12.50})""",
925
+
R"""({"productId": 1, "productName": "A green door", "price": 12.50, "tags": ["home", "green"]})""",
926
+
R"""({"productId": 1, "productName": "A green door", "price": 12.50, "tags": ["home", "green"], "dimensions": {"length": 785, "width": 250.5, "height": -0.359}})""",
923
927
},
924
928
// Failing strings
925
929
{
926
-
"{}", // Missing all required properties
927
-
"{\"productName\": \"A green door\", \"price\": 12.50, \"productId\": 1}", // Out of order properties
930
+
R"""({})""", // Missing all required properties
931
+
R"""({"productName": "A green door", "price": 12.50, "productId": 1})""", // Out of order properties
928
932
// TODO: The following line should fail, but currently it passes. `exclusiveMinimum` is not supported, as it would likely be too difficult to implement.
929
933
// Perhaps special checks for minimum and maximum values of 0 could be added (since that's relatively easy to do with grammars), but anything else would likely be too complex.
930
-
//"{\"productId\": 1, \"productName\": \"A green door\", \"price\": -12.50}",
"{\"productId\": 1, \"productName\": \"A green door\", \"price\": 12.50, \"tags\": []}", // tags is empty, but minItems is 1
934
-
"{\"productId\": 1, \"productName\": \"A green door\", \"price\": 12.50, \"dimensions\": {\"length\": 785, \"width\": 250.5, \"height\": -0.359}, \"tags\": [\"home\", \"green\"]}", // Tags and dimensions are out of order
934
+
//R"""({"productId": 1, "productName": "A green door", "price": -12.50})""",
935
+
R"""({"productId": 1, "productName": "A green door"})""", // Missing required property (price)
936
+
R"""({"productName": "A green door", "price": 12.50})""", // Missing required property (productId)
937
+
R"""({"productId": 1, "productName": "A green door", "price": 12.50, "tags": []})""", // tags is empty, but minItems is 1
938
+
R"""({"productId": 1, "productName": "A green door", "price": 12.50, "dimensions": {"length": 785, "width": 250.5, "height": -0.359}, "tags": ["home", "green"]})""", // Tags and dimensions are out of order
935
939
// TODO: The following line should fail, but currently it passes. `uniqueItems` is not supported, as it would likely be too difficult to implement.
0 commit comments