Update examples/json-schema-to-grammar.py

This commit is contained in:
Georgi Gerganov 2024-02-19 16:13:25 +02:00 committed by GitHub
parent 888f1f5439
commit c1362cbd63
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -93,6 +93,7 @@ class SchemaConverter:
if min_items > 0:
first_item = f"({item_rule_name})"
successive_items = list_item_operator * (min_items - 1)
min_items -= 1
else:
first_item = f"({item_rule_name})?"
max_items = schema.get("maxItems")