Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Greg/debug vscode #1336

Draft
wants to merge 3 commits into
base: canary
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build-vscode-release.reusable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: BAML Release - Build VSCode Extension

on:
workflow_call: {}
push:
- greg/debug-vscode

concurrency:
# suffix is important to prevent a concurrency deadlock with the calling workflow
Expand Down
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@

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

## [0.72.0](https://github.com/boundaryml/baml/compare/0.71.1..0.71.2) - 2025-01-07
## [0.72.1](https://github.com/boundaryml/baml/compare/0.72.0..0.72.1) - 2025-01-07

Patch release to cherry-pick #1334 onto 0.72.0.

### Bug Fixes
- Fix partial types containing literals in generated python (#1334) - ([4b30022](https://github.com/boundaryml/baml/commit/4b3002256a7556f95ef3342998b334709f7c145a)) - Greg Hale


## [0.72.0](https://github.com/boundaryml/baml/compare/0.71.1..0.72.0) - 2025-01-07

### Bug Fixes

Expand Down
32 changes: 16 additions & 16 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.72.0"
version = "0.72.1"
authors = ["Boundary <[email protected]>"]

description = "BAML Toolchain"
Expand Down
12 changes: 12 additions & 0 deletions engine/baml-lib/jsonish/src/tests/test_literals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,3 +343,15 @@ test_failing_deserializer!(
FieldType::Literal(LiteralValue::String("THREE".into())),
])
);

test_partial_deserializer!(
test_partial_class_with_null_literal,
r#"
class Foo {
bar "hello"
}
"#,
r#"{}"#,
FieldType::class("Foo"),
{ "bar": null }
);
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ impl ToTypeReferenceInTypeDefinition for FieldType {
format!("Optional[\"{name}\"]")
}
}
FieldType::Literal(value) => to_python_literal(value),
FieldType::Literal(value) => format!("Optional[{}]", to_python_literal(value)),
FieldType::List(inner) => format!("List[{}]", inner.to_partial_type_ref(ir, true)),
FieldType::Map(key, value) => {
format!(
Expand Down
2 changes: 1 addition & 1 deletion engine/language_client_codegen/src/python/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ impl ToTypeReferenceInClientDefinition for FieldType {
}
FieldType::Class(name) => format!("partial_types.{name}"),
FieldType::RecursiveTypeAlias(name) => format!("types.{name}"),
FieldType::Literal(value) => to_python_literal(value),
FieldType::Literal(value) => format!("Optional[{}]", to_python_literal(value)),
FieldType::List(inner) => {
format!("List[{}]", inner.to_partial_type_ref(ir, with_checked))
}
Expand Down
2 changes: 1 addition & 1 deletion engine/language_client_python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "baml-py"
version = "0.72.0"
version = "0.72.1"
description = "BAML python bindings (pyproject.toml)"
readme = "README.md"
authors = [["Boundary", "[email protected]"]]
Expand Down
2 changes: 1 addition & 1 deletion engine/language_client_ruby/baml.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Gem::Specification.new do |spec|
spec.name = "baml"
spec.version = "0.72.0"
spec.version = "0.72.1"
spec.authors = ["BoundaryML"]
spec.email = ["[email protected]"]

Expand Down
2 changes: 1 addition & 1 deletion engine/language_client_typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@boundaryml/baml",
"version": "0.72.0",
"version": "0.72.1",
"description": "BAML typescript bindings (package.json)",
"repository": {
"type": "git",
Expand Down
8 changes: 4 additions & 4 deletions integ-tests/baml_src/generators.baml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
generator lang_python {
output_type python/pydantic
output_dir "../python"
version "0.72.0"
version "0.72.1"
}

generator lang_typescript {
output_type typescript
output_dir "../typescript"
version "0.72.0"
version "0.72.1"
}

generator lang_ruby {
output_type ruby/sorbet
output_dir "../ruby"
version "0.72.0"
version "0.72.1"
}

// generator openapi {
// output_type rest/openapi
// output_dir "../openapi"
// version "0.72.0"
// version "0.72.1"
// on_generate "rm .gitignore"
// }
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class ClassForNullLiteral {
a "hi"
}

function NullLiteralClassHello(s: string) -> ClassForNullLiteral {
client GPT35
prompt #"
Return the empty object: {}.
"#
}

test NullLiteralClassHello {
functions [NullLiteralClassHello]
args { s "unused" }
}
Loading
Loading