-
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.
Support aliased input class keys (#1045)
<!-- ELLIPSIS_HIDDEN --> > [!IMPORTANT] > This PR adds support for aliased input class keys and enum values, refactors the Jinja crate, and updates tests to verify aliasing behavior. > > - **Behavior**: > - Support for aliased input class keys and enum values. > - Updates to `PromptRenderer` in `prompt_renderer/mod.rs` to handle aliasing. > - **Crate Refactor**: > - Split Jinja into `internal-baml-jinja-types` and `internal-baml-jinja`. > - Update `Cargo.toml` files for new crate structure. > - **Code Changes**: > - Modify imports in `enums.rs`, `functions.rs`, `baml_value_to_jinja_value.rs` to use `internal_baml_jinja_types`. > - Implement `IntoMiniJinjaValue` trait in `baml_value_to_jinja_value.rs`. > - **Testing**: > - Add integration tests in `integ-tests.test.ts` for aliasing behavior. > - Test cases for aliased input classes and enums in `aliased-inputs.baml`. > > <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 2c8240a. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
- Loading branch information
Showing
47 changed files
with
4,036 additions
and
2,677 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
mod map; | ||
mod media; | ||
#[cfg(feature = "mini-jinja")] | ||
mod minijinja; | ||
|
||
mod baml_value; | ||
mod field_type; | ||
|
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
[package] | ||
name = "internal-baml-jinja" | ||
edition = "2021" | ||
version.workspace = true | ||
authors.workspace = true | ||
description.workspace = true | ||
license-file.workspace = true | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
baml-types = { path = "../baml-types", features = ["mini-jinja"] } | ||
internal-baml-jinja-types = { path = "../jinja" } | ||
internal-baml-core = { path = "../baml-core" } | ||
internal-baml-diagnostics = { path = "../diagnostics" } | ||
# TODO: disable imports, etc | ||
minijinja = { version = "1.0.16", default-features = false, features = [ | ||
"macros", | ||
"builtins", | ||
"debug", | ||
"preserve_order", | ||
"adjacent_loop_items", | ||
"unicode", | ||
"json", | ||
"unstable_machinery", | ||
"unstable_machinery_serde", | ||
"custom_syntax", | ||
"internal_debug", | ||
"deserialization", | ||
# We don't want to use these features: | ||
# multi_template | ||
# loader | ||
# | ||
] } | ||
askama.workspace = true | ||
anyhow.workspace = true | ||
indexmap.workspace = true | ||
log.workspace = true | ||
serde.workspace = true | ||
serde_json.workspace = true | ||
strum.workspace = true | ||
strsim = "0.11.1" | ||
colored = "2.1.0" | ||
|
||
[dev-dependencies] | ||
env_logger = "0.11.3" |
Oops, something went wrong.