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");
109
+
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})""",
1008
+
R"""({"productId": 1, "productName": "A green door", "price": 12.50, "tags": ["home", "green"]})""",
1009
+
R"""({"productId": 1, "productName": "A green door", "price": 12.50, "tags": ["home", "green"], "dimensions": {"length": 785, "width": 250.5, "height": -0.359}})""",
1006
1010
},
1007
1011
// Failing strings
1008
1012
{
1009
-
"{}", // Missing all required properties
1010
-
"{\"productName\": \"A green door\", \"price\": 12.50, \"productId\": 1}", // Out of order properties
1013
+
R"""({})""", // Missing all required properties
1014
+
R"""({"productName": "A green door", "price": 12.50, "productId": 1})""", // Out of order properties
1011
1015
// TODO: The following line should fail, but currently it passes. `exclusiveMinimum` is not supported, as it would likely be too difficult to implement.
1012
1016
// 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.
1013
-
//"{\"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
1017
-
"{\"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
1017
+
//R"""({"productId": 1, "productName": "A green door", "price": -12.50})""",
1018
+
R"""({"productId": 1, "productName": "A green door"})""", // Missing required property (price)
1019
+
R"""({"productName": "A green door", "price": 12.50})""", // Missing required property (productId)
1020
+
R"""({"productId": 1, "productName": "A green door", "price": 12.50, "tags": []})""", // tags is empty, but minItems is 1
1021
+
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
1018
1022
// 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