Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make json array generation more flexible #608

Merged
merged 2 commits into from
Feb 5, 2024

Conversation

posionus
Copy link
Contributor

@posionus posionus commented Feb 4, 2024

Makes the regex generated for json arrays more valid and flexible.

  1. Allows for empty lists when min_items == 0
  2. Allows whitespace between array elements
  3. Adds support for maxItems (before, having any maxItems != minItems would allow infinite repeats)

@rlouf
Copy link
Member

rlouf commented Feb 4, 2024

Thank you for opening a PR! Would you mind adding unit tests for the features/behaviors you implemented?

@posionus
Copy link
Contributor Author

posionus commented Feb 5, 2024

Thank you for opening a PR! Would you mind adding unit tests for the features/behaviors you implemented?

Added a new test and fixed existing tests

@rlouf
Copy link
Member

rlouf commented Feb 5, 2024

Thank you again for your contribution!

@rlouf rlouf merged commit aa13d2b into outlines-dev:main Feb 5, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants