-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add constraints via Jinja expressions (#1006)
<!-- ELLIPSIS_HIDDEN --> > [!IMPORTANT] > This PR adds support for constraints using Jinja expressions, updates models and validation logic, and enhances testing for constraint functionality. > > - **Behavior**: > - Add support for constraints using Jinja expressions in `baml-core`. > - Implement `evaluate_predicate` in `internal_baml_jinja` for constraint evaluation. > - Update `FieldType` to support `Constrained` type with constraints. > - **Models**: > - Add `Constraint` and `ConstraintLevel` in `baml-types`. > - Update `NodeAttributes` to include constraints. > - **Validation**: > - Add validation for constraints in `validation_pipeline`. > - Ensure constraints are not allowed as function parameters. > - **Testing**: > - Add tests for constraints in `test_constraints.rs`. > - Update integration tests to check constraint functionality. > - **Misc**: > - Add `itertools` dependency in `Cargo.lock`. > - Update `shell.nix` to include necessary tools for development. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup> for 316ac5f. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
- Loading branch information
1 parent
45b91d3
commit d794f28
Showing
131 changed files
with
5,645 additions
and
2,206 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.