Skip to content

Commit

Permalink
Merge canary
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniosarosi committed Dec 19, 2024
2 parents 1f4007e + 8cac1ef commit d31fe7d
Show file tree
Hide file tree
Showing 53 changed files with 1,345 additions and 502 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ on:
tags:
- "test-release/*.*"
- "*.*"
branches: []
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand Down Expand Up @@ -49,7 +48,7 @@ jobs:
- build-vscode-release
steps:
- run: echo "::do-nothing::" >/dev/null

publish-to-pypi:
environment: release
needs: [all-builds]
Expand Down Expand Up @@ -165,6 +164,7 @@ jobs:
done
publish-to-github:
environment: release
needs: [all-builds]
if: ${{ startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
Expand All @@ -182,6 +182,7 @@ jobs:
body: ${{steps.latest_release.outputs.changelog}}

publish-to-open-vsx:
environment: release
needs: [all-builds]
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/') || inputs.force_publish_vscode }}
Expand All @@ -203,6 +204,7 @@ jobs:
OVSX_PAT: ${{ secrets.OVSX_PAT }}

publish-to-vscode-marketplace:
environment: release
needs: [all-builds]
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/') || inputs.force_publish_vscode }}
Expand All @@ -221,4 +223,4 @@ jobs:
cd typescript/vscode-ext/packages
pnpm vsce publish --packagePath ./out/*.vsix
env:
VSCE_PAT: ${{ secrets.VSCODE_PAT }}
VSCE_PAT: ${{ secrets.VSCODE_PAT }}
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@

All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines.

## [0.70.5](https://github.com/boundaryml/baml/compare/0.70.1..0.70.5) - 2024-12-13

### Bug Fixes

- Remove log statements (#1230) - ([4bcdd19](https://github.com/boundaryml/baml/commit/4bcdd198f219cd016ee64cc6444dd62e69f796fb)) - hellovai
- Fix playground proxy related issues (#1228, #1229, #1237) - ([7384ba8](https://github.com/boundaryml/baml/commit/7384ba8cb5d1f012c50ddfb2a44a142ec9654397)) ([7bb6df4](https://github.com/boundaryml/baml/commit/7bb6df40fe37753b946ceeec6b30c4d9cdcc4ce7)) ([16054f5](https://github.com/boundaryml/baml/commit/16054f5f858dcaf80f013d466ceb9354c6a160b7)) - aaronvg

### DOCS

- deno run instead of dpx (#1225) - ([7c64299](https://github.com/boundaryml/baml/commit/7c642992cd7d52b7e7cd718542dfa68c41b5aab3)) - Jeffrey Konowitch
- Fix broken links (#1235) - ([859c699](https://github.com/boundaryml/baml/commit/859c6998cef7950d52cc3287f51d74106a58d89d)) - Samuel Lijin

### Features

- Support parsing primitive values from single-key objects (#1224) - ([935a190](https://github.com/boundaryml/baml/commit/935a190556d12077f961ce083723e7c1f816f387)) - revidious


## [0.70.1](https://github.com/boundaryml/baml/compare/0.70.0..0.70.1) - 2024-12-05

### Bug Fixes
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Share your creations and ask questions in our [Discord](https://discord.gg/BTNBe

- [BAML + NextJS 14](https://github.com/BoundaryML/baml-examples/tree/main/nextjs-starter)
- [BAML + FastAPI + Streaming](https://github.com/BoundaryML/baml-examples/tree/main/python-fastapi-starter)
- [All BAML Examples](https://github.com/BoundaryML/baml-examples)

## A BAML LLM Function

Expand Down
36 changes: 18 additions & 18 deletions engine/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ internal-baml-jinja = { path = "baml-lib/jinja" }
internal-baml-schema-ast = { path = "baml-lib/schema-ast" }

[workspace.package]
version = "0.70.1"
version = "0.70.5"
authors = ["Boundary <[email protected]>"]

description = "BAML Toolchain"
Expand Down
17 changes: 17 additions & 0 deletions engine/baml-lib/jsonish/src/deserializer/coercer/coerce_literal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use internal_baml_core::ir::FieldType;
use crate::{
deserializer::{
coercer::{coerce_primitive::coerce_bool, match_string::match_string, TypeCoercer},
deserialize_flags::{DeserializerConditions, Flag},
types::BamlValueWithFlags,
},
jsonish,
Expand Down Expand Up @@ -46,6 +47,22 @@ impl TypeCoercer for LiteralValue {
Some(v) => v,
};

// If we get an object with a single key-value pair, try to extract the value
if let jsonish::Value::Object(obj) = value {
if obj.len() == 1 {
let (key, inner_value) = obj.iter().next().unwrap();
// only extract value if it's a primitive (not an object or array, hoping to god its fixed)
match inner_value {
jsonish::Value::Number(_) | jsonish::Value::Boolean(_) | jsonish::Value::String(_) => {
let mut result = self.coerce(ctx, target, Some(inner_value))?;
result.add_flag(Flag::ObjectToPrimitive(jsonish::Value::Object(obj.clone())));
return Ok(result);
}
_ => {}
}
}
}

match literal {
LiteralValue::Int(literal_int) => {
let BamlValueWithFlags::Int(coerced_int) = coerce_int(ctx, target, Some(value))?
Expand Down
Loading

0 comments on commit d31fe7d

Please sign in to comment.