-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- **Adding unit test** - **Adding commit to fix parsing** <!-- ELLIPSIS_HIDDEN --> ---- > [!IMPORTANT] > Replaces `coerce` with `cast` for type handling, introduces `DifferentiateUnions` for union types, and updates Python, TypeScript, and Ruby client implementations. > > - **Behavior**: > - Replaces `coerce` with `cast` in `async_client.py.j2`, `sync_client.py.j2`, and `baml_py.pyi`. > - Introduces `DifferentiateUnions` for handling `OriginalA` and `OriginalB` union types. > - **TypeScript**: > - Updates `sync_client.ts`, `type_builder.ts`, and `types.ts` for `DifferentiateUnions` and casting logic. > - **Ruby**: > - Updates `client.rb`, `inlined.rb`, and `partial-types.rb` for `DifferentiateUnions` and casting changes. > - **Tests**: > - Adds `test_differing_unions` in `test_functions.py` to validate `DifferentiateUnions`. > > <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 3eb3ec3. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
- Loading branch information
Showing
25 changed files
with
1,195 additions
and
1,373 deletions.
There are no files selected for viewing
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
17 changes: 17 additions & 0 deletions
17
integ-tests/baml_src/test-files/dynamic/differentiate_unions.baml
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,17 @@ | ||
class OriginalA { | ||
value int | ||
} | ||
|
||
class OriginalB { | ||
value int | ||
@@dynamic | ||
} | ||
|
||
function DifferentiateUnions() -> OriginalA | OriginalB { | ||
client "openai/gpt-4o-mini" | ||
prompt #" | ||
Create a data model that represents the latter of the two classes. | ||
|
||
{{ ctx.output_format }} | ||
"# | ||
} |
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.