Summary
- faster `Formatter` compilation
- Refactors to make internal implementation and public API cleaner
- Native support for basic json schema(all `type` keyword constraints and recursion)
- Basic support for substring extraction
What's changed
- Removed `grammar_generators` package completely.
- `JsonExtractor` class is moved to `formats.json` package.
- `FormatterBuilder.schema()` is removed.
- Added `FormatterBuilder.json()` which is simpler to use than `FormatterBuilder.schema()`.
- `RegexExtractor` is moved from `extractor` to `formats.regex`
- `kbnf_representation` is renamed to `kbnf_reference` and `nonterminal` is renamed to `kbnf_definition` for clarity in `Extractor`.
- `NonterminalExtractor` is added to better illustrate the differences in interfaces&implementation between `LiteralExtractor` and other extractors.
- `LiteralExtractor` is private now,
- Bug fix: JsonExtractor will no longer produce `None` when parsing json where some keys/values contain `{` or `}`.
- Make `Formatron` compatible with the newest `vllm==0.6.0` and `exllamav2==0.2.1`.
- Faster constrained decoding with `exllamav2` integration thanks to turboderp 's optimizations in his `exllamav2` library.
- Faster `kbnf.Vocabulary` creation by turboderp in https://github.com/Dan-wanna-M/formatron/pull/10
- Update docs, benchmarks and comments accordingly.
**Full Changelog**: https://github.com/Dan-wanna-M/formatron/compare/v0.3.4...v0.4.0