Skip to content

Commit d820f58

Browse files
Fixed grammar issues with lists
1 parent 9832632 commit d820f58

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "llama-cpp-agent"
7-
version = "0.0.30"
7+
version = "0.0.31"
88
description = "A framework for building LLM based AI agents with llama.cpp."
99

1010
readme = "ReadMe.md"
1111
dependencies = [
1212
"llama-cpp-python>=0.2.60",
1313
"pydantic>=2.5.3",
14-
"requests==2.31.0",
14+
"requests>=2.31.0",
1515
"docstring_parser"
1616
]
1717

src/llama_cpp_agent/gbnf_grammar_generator/gbnf_grammar_from_pydantic_models.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ def generate_gbnf_rule_for_type(
352352
created_rules,
353353
)
354354
rules.extend(additional_rules)
355-
array_rule = rf"""{model_name}-{field_name} ::= "[" ws ({element_rule_name})* ("," ws {element_rule_name})* ws "]" """
355+
array_rule = rf"""{model_name}-{field_name} ::= "[" ws ({element_rule_name})? ("," ws {element_rule_name})* ws "]" """
356356
rules.append(array_rule)
357357
gbnf_type, rules = model_name + "-" + field_name, rules
358358

@@ -367,7 +367,7 @@ def generate_gbnf_rule_for_type(
367367
created_rules,
368368
)
369369
rules.extend(additional_rules)
370-
array_rule = rf"""{model_name}-{field_name} ::= "[" ws ({element_rule_name})* ("," ws {element_rule_name})* ws "]" """
370+
array_rule = rf"""{model_name}-{field_name} ::= "[" ws ({element_rule_name})? ("," ws {element_rule_name})* ws "]" """
371371
rules.append(array_rule)
372372
gbnf_type, rules = model_name + "-" + field_name, rules
373373

0 commit comments

Comments
 (0)