Skip to content

Commit 8e8f36f

Browse files
committed
Sync examples : fix empty items in json_schema_to_grammar.py (#19968)
1 parent 054f04e commit 8e8f36f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

llama_cpp/llama_grammar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ def add_component(comp_schema, is_required):
890890
return self._add_rule(rule_name, self._build_object_rule(properties, required, hybrid_name, additional_properties=None))
891891

892892
elif schema_type in (None, 'array') and ('items' in schema or 'prefixItems' in schema):
893-
items = schema.get('items') or schema['prefixItems']
893+
items = schema.get('items', schema.get('prefixItems'))
894894
if isinstance(items, list):
895895
return self._add_rule(
896896
rule_name,

0 commit comments

Comments
 (0)