Commit 326de95
authored
feat(bridges): support providing host callables as lambdas with optional args (#3787)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
## Release Notes
* **New Features**
* Improved TypeScript callable typings for optional parameters using a
trailing `$opts?: { ... }` object.
* **Bug Fixes**
* Host-callable dispatch now consistently routes required positional
arguments separately from named optional arguments, with omitted
optionals correctly using the host’s defaults.
* Updated host-call argument payload handling to support the new
argument envelope consistently across runtimes.
* **Documentation**
* Expanded documentation describing the expected host-call argument
structure and optional semantics.
* **Tests**
* Added/updated fixtures and end-to-end tests for optional-argument
behavior and validation (including broken-syntax cases).
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 012146e commit 326de95
41 files changed
Lines changed: 2986 additions & 481 deletions
File tree
- baml_language
- crates
- baml_builtins2/baml_std/baml/ns_host
- baml_cli/src/snapshots
- baml_tests
- projects/broken_syntax/optional_parameter_defaults
- snapshots/broken_syntax/optional_parameter_defaults
- src/compiler2_tir/snapshots
- bex_engine
- src
- tests
- bex_vm_types/src
- bex_vm/src
- bridge_ctypes
- src
- types/baml_core/cffi/v1
- bridge_wasm
- src
- tests
- sys_native/src
- sdk_tests
- crates
- python_pydantic2/function_calls/customizable
- typescript_node/function_calls/customizable
- fixtures/function_calls/baml_src/ns_host_callable_tests
- sdks
- go/bridge_go
- cffi/proto/baml_core/cffi/v1
- pkg
- nodejs
- bridge_nodejs
- dist
- proto
- typescript_src
- proto
- sdkgen_typescript_node/src
- python
- rust
- bridge_python/src
- sdkgen_python_pydantic2
- src
- emit
- src/baml_core/cffi/v1
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
13 | 20 | | |
14 | 21 | | |
15 | 22 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
109 | | - | |
| 108 | + | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
585 | 585 | | |
586 | 586 | | |
587 | 587 | | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
588 | 592 | | |
589 | 593 | | |
590 | 594 | | |
| |||
0 commit comments