diff --git a/engine/language_client_codegen/src/typescript/templates/async_client.ts.j2 b/engine/language_client_codegen/src/typescript/templates/async_client.ts.j2 index 5aca35d02..6762ace9b 100644 --- a/engine/language_client_codegen/src/typescript/templates/async_client.ts.j2 +++ b/engine/language_client_codegen/src/typescript/templates/async_client.ts.j2 @@ -1,4 +1,5 @@ import { BamlRuntime, FunctionResult, BamlCtxManager, BamlStream, Image, ClientRegistry, BamlValidationError, createBamlValidationError } from "@boundaryml/baml" +import { Checked, Check } from "./types" import { {%- for t in types %}{{ t }}{% if !loop.last %}, {% endif %}{% endfor -%} } from "./types" diff --git a/engine/language_client_codegen/src/typescript/templates/sync_client.ts.j2 b/engine/language_client_codegen/src/typescript/templates/sync_client.ts.j2 index f43ad5cd6..1a6b1b41b 100644 --- a/engine/language_client_codegen/src/typescript/templates/sync_client.ts.j2 +++ b/engine/language_client_codegen/src/typescript/templates/sync_client.ts.j2 @@ -1,5 +1,6 @@ import { BamlRuntime, FunctionResult, BamlCtxManager, BamlSyncStream, Image, ClientRegistry, createBamlValidationError, BamlValidationError } from "@boundaryml/baml" -import { +import { Checked, Check } from "./types" +import { {%- for t in types %}{{ t }}{% if !loop.last %}, {% endif %}{% endfor -%} } from "./types" import TypeBuilder from "./type_builder" diff --git a/engine/language_client_codegen/src/typescript/templates/types.ts.j2 b/engine/language_client_codegen/src/typescript/templates/types.ts.j2 index 192b9786c..247515b72 100644 --- a/engine/language_client_codegen/src/typescript/templates/types.ts.j2 +++ b/engine/language_client_codegen/src/typescript/templates/types.ts.j2 @@ -1,5 +1,24 @@ import { Image } from "@boundaryml/baml" +export interface Checked { + value: T, + checks: Record, +} + +export interface Check { + name: string, + expr: string + status: "succeeded" | "failed" +} + +export function all_succeeded(checks: Record): boolean { + return get_checks(checks).every(check => check.status === "succeeded") +} + +export function get_checks(checks: Record): Check[] { + return Object.values(checks) +} + {%- for enum in enums %} export enum {{enum.name}} { {%- for value in enum.values %} diff --git a/engine/language_client_typescript/checked.d.ts b/engine/language_client_typescript/checked.d.ts deleted file mode 100644 index 5231a737e..000000000 --- a/engine/language_client_typescript/checked.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export interface Checked { - value: T; - checks: Record; -} -export interface Check { - name: string; - expr: string; - status: "succeeded" | "failed"; -} -export declare function all_succeeded(checks: Record): boolean; -export declare function get_checks(checks: Record): Check[]; -//# sourceMappingURL=checked.d.ts.map \ No newline at end of file diff --git a/engine/language_client_typescript/checked.d.ts.map b/engine/language_client_typescript/checked.d.ts.map deleted file mode 100644 index 2d4ba2777..000000000 --- a/engine/language_client_typescript/checked.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"checked.d.ts","sourceRoot":"","sources":["typescript_src/checked.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO,CAAC,CAAC,EAAC,SAAS,SAAS,MAAM,GAAG,MAAM;IACxD,KAAK,EAAE,CAAC,CAAC;IACT,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,KAAK;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,WAAW,GAAG,QAAQ,CAAA;CACjC;AAED,wBAAgB,aAAa,CAAC,SAAS,SAAS,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,GAAG,OAAO,CAEjG;AAED,wBAAgB,UAAU,CAAC,SAAS,SAAS,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,GAAG,KAAK,EAAE,CAE9F"} \ No newline at end of file diff --git a/engine/language_client_typescript/checked.js b/engine/language_client_typescript/checked.js deleted file mode 100644 index 82f328cac..000000000 --- a/engine/language_client_typescript/checked.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.get_checks = exports.all_succeeded = void 0; -function all_succeeded(checks) { - return get_checks(checks).every(check => check.status === "succeeded"); -} -exports.all_succeeded = all_succeeded; -function get_checks(checks) { - return Object.values(checks); -} -exports.get_checks = get_checks; diff --git a/engine/language_client_typescript/index.d.ts b/engine/language_client_typescript/index.d.ts index 2a991d309..dafbd2ff7 100644 --- a/engine/language_client_typescript/index.d.ts +++ b/engine/language_client_typescript/index.d.ts @@ -1,7 +1,6 @@ export { BamlRuntime, FunctionResult, FunctionResultStream, BamlImage as Image, ClientBuilder, BamlAudio as Audio, invoke_runtime_cli, ClientRegistry, BamlLogEvent, } from './native'; export { BamlStream } from './stream'; export { BamlCtxManager } from './async_context_vars'; -export { Checked } from './checked'; export declare class BamlValidationError extends Error { prompt: string; raw_output: string; diff --git a/engine/language_client_typescript/index.d.ts.map b/engine/language_client_typescript/index.d.ts.map index f8fcf9ef8..678922c63 100644 --- a/engine/language_client_typescript/index.d.ts.map +++ b/engine/language_client_typescript/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["typescript_src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,cAAc,EACd,oBAAoB,EACpB,SAAS,IAAI,KAAK,EAClB,aAAa,EACb,SAAS,IAAI,KAAK,EAClB,kBAAkB,EAClB,cAAc,EACd,YAAY,GACb,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;gBAEN,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAS/D,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,GAAG,mBAAmB,GAAG,KAAK;IAuBtD,MAAM,IAAI,MAAM;CAWjB;AAGD,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,KAAK,GAAG,mBAAmB,GAAG,KAAK,CAEnF"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["typescript_src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,cAAc,EACd,oBAAoB,EACpB,SAAS,IAAI,KAAK,EAClB,aAAa,EACb,SAAS,IAAI,KAAK,EAClB,kBAAkB,EAClB,cAAc,EACd,YAAY,GACb,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAErD,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;gBAEN,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAS/D,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,GAAG,mBAAmB,GAAG,KAAK;IAuBtD,MAAM,IAAI,MAAM;CAWjB;AAGD,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,KAAK,GAAG,mBAAmB,GAAG,KAAK,CAEnF"} \ No newline at end of file diff --git a/engine/language_client_typescript/typescript_src/checked.ts b/engine/language_client_typescript/typescript_src/checked.ts deleted file mode 100644 index 35a43d2f6..000000000 --- a/engine/language_client_typescript/typescript_src/checked.ts +++ /dev/null @@ -1,18 +0,0 @@ -export interface Checked { - value: T, - checks: Record, -} - -export interface Check { - name: string, - expr: string - status: "succeeded" | "failed" -} - -export function all_succeeded(checks: Record): boolean { - return get_checks(checks).every(check => check.status === "succeeded") -} - -export function get_checks(checks: Record): Check[] { - return Object.values(checks) -} diff --git a/engine/language_client_typescript/typescript_src/index.ts b/engine/language_client_typescript/typescript_src/index.ts index c4f5a70ff..27bd94611 100644 --- a/engine/language_client_typescript/typescript_src/index.ts +++ b/engine/language_client_typescript/typescript_src/index.ts @@ -11,7 +11,6 @@ export { } from './native' export { BamlStream } from './stream' export { BamlCtxManager } from './async_context_vars' -export { Checked } from './checked' export class BamlValidationError extends Error { prompt: string diff --git a/fern/01-guide/05-baml-advanced/validations.mdx b/fern/01-guide/05-baml-advanced/validations.mdx index daef57cf8..6fe3d7d03 100644 --- a/fern/01-guide/05-baml-advanced/validations.mdx +++ b/fern/01-guide/05-baml-advanced/validations.mdx @@ -271,9 +271,8 @@ def main(): ``` ```typescript Typescript -import { b } from './baml_client' +import { b, get_checks } from './baml_client' import { Citation } from './baml_client/types' -import { get_checks } from '@boundaryml/baml/checked' const main = () => { const citation = b.GetCitation("SpaceX, is an American spacecraft manufacturer, launch service provider...") diff --git a/integ-tests/typescript/baml_client/async_client.ts b/integ-tests/typescript/baml_client/async_client.ts index e793c6ea8..2499d505d 100644 --- a/integ-tests/typescript/baml_client/async_client.ts +++ b/integ-tests/typescript/baml_client/async_client.ts @@ -16,6 +16,7 @@ $ pnpm add @boundaryml/baml // @ts-nocheck // biome-ignore format: autogenerated code import { BamlRuntime, FunctionResult, BamlCtxManager, BamlStream, Image, ClientRegistry, BamlValidationError, createBamlValidationError } from "@boundaryml/baml" +import { Checked, Check } from "./types" import {BigNumbers, Blah, BlockConstraint, BlockConstraintForParam, BookOrder, ClassOptionalOutput, ClassOptionalOutput2, ClassWithImage, CompoundBigNumbers, ContactInfo, CustomTaskResult, DummyOutput, DynInputOutput, DynamicClassOne, DynamicClassTwo, DynamicOutput, Earthling, Education, Email, EmailAddress, Event, FakeImage, FlightConfirmation, FooAny, GroceryReceipt, InnerClass, InnerClass2, InputClass, InputClassNested, LiteralClassHello, LiteralClassOne, LiteralClassTwo, MalformedConstraints, MalformedConstraints2, Martian, NamedArgsSingleClass, Nested, Nested2, NestedBlockConstraint, NestedBlockConstraintForParam, OptionalTest_Prop1, OptionalTest_ReturnType, OrderInfo, OriginalA, OriginalB, Person, PhoneNumber, Quantity, RaysData, ReceiptInfo, ReceiptItem, Recipe, Resume, Schema, SearchParams, SomeClassNestedDynamic, StringToClassEntry, TestClassAlias, TestClassNested, TestClassWithEnum, TestOutputClass, TwoStoriesOneTitle, UnionTest_ReturnType, WithReasoning, AliasedEnum, Category, Category2, Category3, Color, DataType, DynEnumOne, DynEnumTwo, EnumInClass, EnumOutput, Hobby, NamedArgsSingleEnum, NamedArgsSingleEnumList, OptionalTest_CategoryType, OrderStatus, Tag, TestEnum} from "./types" import TypeBuilder from "./type_builder" import { DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_CTX, DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_RUNTIME } from "./globals" diff --git a/integ-tests/typescript/baml_client/sync_client.ts b/integ-tests/typescript/baml_client/sync_client.ts index fde6a74e6..93c072554 100644 --- a/integ-tests/typescript/baml_client/sync_client.ts +++ b/integ-tests/typescript/baml_client/sync_client.ts @@ -16,6 +16,7 @@ $ pnpm add @boundaryml/baml // @ts-nocheck // biome-ignore format: autogenerated code import { BamlRuntime, FunctionResult, BamlCtxManager, BamlSyncStream, Image, ClientRegistry, createBamlValidationError, BamlValidationError } from "@boundaryml/baml" +import { Checked, Check } from "./types" import {BigNumbers, Blah, BlockConstraint, BlockConstraintForParam, BookOrder, ClassOptionalOutput, ClassOptionalOutput2, ClassWithImage, CompoundBigNumbers, ContactInfo, CustomTaskResult, DummyOutput, DynInputOutput, DynamicClassOne, DynamicClassTwo, DynamicOutput, Earthling, Education, Email, EmailAddress, Event, FakeImage, FlightConfirmation, FooAny, GroceryReceipt, InnerClass, InnerClass2, InputClass, InputClassNested, LiteralClassHello, LiteralClassOne, LiteralClassTwo, MalformedConstraints, MalformedConstraints2, Martian, NamedArgsSingleClass, Nested, Nested2, NestedBlockConstraint, NestedBlockConstraintForParam, OptionalTest_Prop1, OptionalTest_ReturnType, OrderInfo, OriginalA, OriginalB, Person, PhoneNumber, Quantity, RaysData, ReceiptInfo, ReceiptItem, Recipe, Resume, Schema, SearchParams, SomeClassNestedDynamic, StringToClassEntry, TestClassAlias, TestClassNested, TestClassWithEnum, TestOutputClass, TwoStoriesOneTitle, UnionTest_ReturnType, WithReasoning, AliasedEnum, Category, Category2, Category3, Color, DataType, DynEnumOne, DynEnumTwo, EnumInClass, EnumOutput, Hobby, NamedArgsSingleEnum, NamedArgsSingleEnumList, OptionalTest_CategoryType, OrderStatus, Tag, TestEnum} from "./types" import TypeBuilder from "./type_builder" import { DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_CTX, DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_RUNTIME } from "./globals" diff --git a/integ-tests/typescript/baml_client/types.ts b/integ-tests/typescript/baml_client/types.ts index d43a9c50c..a46944668 100644 --- a/integ-tests/typescript/baml_client/types.ts +++ b/integ-tests/typescript/baml_client/types.ts @@ -16,6 +16,25 @@ $ pnpm add @boundaryml/baml // @ts-nocheck // biome-ignore format: autogenerated code import { Image } from "@boundaryml/baml" + +export interface Checked { + value: T, + checks: Record, +} + +export interface Check { + name: string, + expr: string + status: "succeeded" | "failed" +} + +export function all_succeeded(checks: Record): boolean { + return get_checks(checks).every(check => check.status === "succeeded") +} + +export function get_checks(checks: Record): Check[] { + return Object.values(checks) +} export enum AliasedEnum { KEY_ONE = "KEY_ONE", KEY_TWO = "KEY_TWO", diff --git a/integ-tests/typescript/test-report.html b/integ-tests/typescript/test-report.html index c2747f4a5..ff4f92789 100644 --- a/integ-tests/typescript/test-report.html +++ b/integ-tests/typescript/test-report.html @@ -257,37 +257,6 @@ font-size: 1rem; padding: 0 0.5rem; } -

Test Report

Started: 2024-10-31 15:23:13
Suites (1)
0 passed
1 failed
0 pending
Tests (61)
58 passed
3 failed
0 pending
Integ tests > should work for all inputs
single bool
passed
0.528s
Integ tests > should work for all inputs
single string list
passed
0.596s
Integ tests > should work for all inputs
return literal union
failed
0.625s
BamlValidationError: BamlValidationError: Failed to parse LLM response: Failed to coerce value: <root>: Failed to find any (1 | true | "string output") in 3 items
-  - <root>: Expected 1, got Object([("result", String("true"))]).
-  - <root>: Expected true, got Object([("result", String("true"))]).
-  - <root>: Expected "string output", got Object([("result", String("true"))]).
-    at Function.from (/Users/greghale/code/baml/engine/language_client_typescript/index.js:33:28)
-    at from (/Users/greghale/code/baml/engine/language_client_typescript/index.js:58:32)
-    at BamlAsyncClient.LiteralUnionsTest (/Users/greghale/code/baml/integ-tests/typescript/baml_client/async_client.ts:1361:50)
-    at Object.<anonymous> (/Users/greghale/code/baml/integ-tests/typescript/tests/integ-tests.test.ts:42:19)
Integ tests > should work for all inputs
single class
passed
0.57s
Integ tests > should work for all inputs
multiple classes
passed
0.691s
Integ tests > should work for all inputs
single enum list
passed
0.512s
Integ tests > should work for all inputs
single float
passed
0.446s
Integ tests > should work for all inputs
single int
passed
0.351s
Integ tests > should work for all inputs
single literal int
passed
0.542s
Integ tests > should work for all inputs
single literal bool
passed
0.804s
Integ tests > should work for all inputs
single literal string
passed
0.62s
Integ tests > should work for all inputs
single class with literal prop
passed
0.636s
Integ tests > should work for all inputs
single class with literal union prop
failed
0.595s
Error: expect(received).toEqual(expected) // deep equality
-
-- Expected  - 1
-+ Received  + 1
-
-  Object {
--   "prop": "one",
-+   "prop": "two",
-  }
-    at Object.toEqual (/Users/greghale/code/baml/integ-tests/typescript/tests/integ-tests.test.ts:111:19)
Integ tests > should work for all inputs
single optional string
passed
0.756s
Integ tests > should work for all inputs
single map string to string
passed
0.665s
Integ tests > should work for all inputs
single map string to class
passed
0.855s
Integ tests > should work for all inputs
single map string to map
passed
0.823s
Integ tests
should work for all outputs
passed
5.464s
Integ tests
works with retries1
passed
1.251s
Integ tests
works with retries2
passed
2.199s
Integ tests
works with fallbacks
passed
2.065s
Integ tests
should work with image from url
passed
1.571s
Integ tests
should work with image from base 64
passed
1.011s
Integ tests
should work with audio base 64
passed
1.135s
Integ tests
should work with audio from url
passed
1.38s
Integ tests
should support streaming in OpenAI
passed
2.451s
Integ tests
should support streaming in Gemini
passed
10.416s
Integ tests
should support AWS
passed
2.138s
Integ tests
should support streaming in AWS
passed
1.937s
Integ tests
should support OpenAI shorthand
passed
7.929s
Integ tests
should support OpenAI shorthand streaming
passed
7.467s
Integ tests
should support anthropic shorthand
passed
2.847s
Integ tests
should support anthropic shorthand streaming
passed
2.415s
Integ tests
should support streaming without iterating
passed
2.793s
Integ tests
should support streaming in Claude
passed
1.12s
Integ tests
should support vertex
passed
7.511s
Integ tests
supports tracing sync
passed
0.021s
Integ tests
supports tracing async
passed
3.391s
Integ tests
should work with dynamic types single
passed
1.142s
Integ tests
should work with dynamic types enum
passed
0.868s
Integ tests
should work with dynamic literals
passed
0.66s
Integ tests
should work with dynamic types class
passed
0.98s
Integ tests
should work with dynamic inputs class
passed
0.715s
Integ tests
should work with dynamic inputs list
passed
0.675s
Integ tests
should work with dynamic output map
passed
1.07s
Integ tests
should work with dynamic output union
passed
2.144s
Integ tests
should work with nested classes
failed
4.175s
Error: expect(received).toEqual(expected) // deep equality
-
-- Expected  - 1
-+ Received  + 1
-
-  Object {
-    "prop1": "value1",
-    "prop2": Object {
-      "inner": Object {
-        "prop2": 42,
--       "prop3": 3.14,
-+       "prop3": null,
-      },
-      "prop1": "value2",
-      "prop2": "value3",
-    },
-  }
-    at Object.toEqual (/Users/greghale/code/baml/integ-tests/typescript/tests/integ-tests.test.ts:580:25)
Integ tests
should work with dynamic client
passed
0.431s
Integ tests
should work with 'onLogEvent'
passed
1.927s
Integ tests
should work with a sync client
passed
0.633s
Integ tests
should raise an error when appropriate
passed
0.852s
Integ tests
should raise a BAMLValidationError
passed
0.583s
Integ tests
should reset environment variables correctly
passed
0.807s
Integ tests
should use aliases when serializing input objects - classes
passed
0.913s
Integ tests
should use aliases when serializing, but still have original keys in jinja
passed
0.991s
Integ tests
should use aliases when serializing input objects - enums
passed
0.477s
Integ tests
should use aliases when serializing input objects - lists
passed
0.396s
Integ tests
constraints: should handle checks in return types
passed
1.123s
Integ tests
constraints: should handle checks in returned unions
passed
0.906s
Integ tests
constraints: should handle block-level checks
passed
0.732s
Integ tests
constraints: should handle nested-block-level checks
passed
0.666s
\ No newline at end of file +

Test Report

Started: 2024-11-03 15:38:34
Suites (1)
0 passed
1 failed
0 pending
Tests (61)
60 passed
1 failed
0 pending
Integ tests > should work for all inputs
single bool
passed
0.987s
Integ tests > should work for all inputs
single string list
passed
0.644s
Integ tests > should work for all inputs
return literal union
passed
0.482s
Integ tests > should work for all inputs
single class
passed
0.593s
Integ tests > should work for all inputs
multiple classes
passed
0.69s
Integ tests > should work for all inputs
single enum list
passed
0.575s
Integ tests > should work for all inputs
single float
passed
0.753s
Integ tests > should work for all inputs
single int
passed
0.456s
Integ tests > should work for all inputs
single literal int
passed
0.609s
Integ tests > should work for all inputs
single literal bool
passed
0.656s
Integ tests > should work for all inputs
single literal string
passed
0.564s
Integ tests > should work for all inputs
single class with literal prop
passed
0.748s
Integ tests > should work for all inputs
single class with literal union prop
passed
0.657s
Integ tests > should work for all inputs
single optional string
passed
0.462s
Integ tests > should work for all inputs
single map string to string
passed
0.624s
Integ tests > should work for all inputs
single map string to class
passed
0.782s
Integ tests > should work for all inputs
single map string to map
passed
0.763s
Integ tests
should work for all outputs
passed
6.653s
Integ tests
works with retries1
passed
1.898s
Integ tests
works with retries2
passed
2.694s
Integ tests
works with fallbacks
passed
3.392s
Integ tests
should work with image from url
passed
2.014s
Integ tests
should work with image from base 64
passed
0.978s
Integ tests
should work with audio base 64
passed
1.381s
Integ tests
should work with audio from url
passed
1.541s
Integ tests
should support streaming in OpenAI
passed
2.747s
Integ tests
should support streaming in Gemini
passed
7.485s
Integ tests
should support AWS
passed
1.931s
Integ tests
should support streaming in AWS
passed
1.933s
Integ tests
should support OpenAI shorthand
passed
6.994s
Integ tests
should support OpenAI shorthand streaming
passed
7.415s
Integ tests
should support anthropic shorthand
passed
3.821s
Integ tests
should support anthropic shorthand streaming
passed
2.984s
Integ tests
should support streaming without iterating
passed
2.501s
Integ tests
should support streaming in Claude
passed
1.12s
Integ tests
should support vertex
passed
7.516s
Integ tests
supports tracing sync
passed
0.011s
Integ tests
supports tracing async
passed
5.015s
Integ tests
should work with dynamic types single
passed
0.896s
Integ tests
should work with dynamic types enum
passed
1.14s
Integ tests
should work with dynamic literals
passed
0.803s
Integ tests
should work with dynamic types class
passed
0.96s
Integ tests
should work with dynamic inputs class
passed
0.654s
Integ tests
should work with dynamic inputs list
passed
0.8s
Integ tests
should work with dynamic output map
passed
0.877s
Integ tests
should work with dynamic output union
passed
2.418s
Integ tests
should work with nested classes
failed
0.106s
Error: BamlError: BamlClientError: Something went wrong with the LLM client: LLM call failed: LLMErrorResponse { client: "Ollama", model: None, prompt: Chat([RenderedChatMessage { role: "system", allow_duplicate_role: false, parts: [Text("Return a made up json blob that matches this schema:\nAnswer in JSON using this schema:\n{\n  prop1: string,\n  prop2: {\n    prop1: string,\n    prop2: string,\n    inner: {\n      prop2: int,\n      prop3: float,\n    },\n  },\n}\n---\n\nJSON:")] }]), request_options: {"model": String("llama2")}, start_time: SystemTime { tv_sec: 1730677207, tv_nsec: 831045000 }, latency: 2.707208ms, message: "reqwest::Error { kind: Request, url: Url { scheme: \"http\", cannot_be_a_base: false, username: \"\", password: None, host: Some(Domain(\"localhost\")), port: Some(11434), path: \"/v1/chat/completions\", query: None, fragment: None }, source: hyper_util::client::legacy::Error(Connect, ConnectError(\"tcp connect error\", Os { code: 61, kind: ConnectionRefused, message: \"Connection refused\" })) }", code: Other(2) }
+    at BamlStream.parsed [as getFinalResponse] (/Users/greghale/code/baml/engine/language_client_typescript/stream.js:58:39)
+    at Object.<anonymous> (/Users/greghale/code/baml/integ-tests/typescript/tests/integ-tests.test.ts:578:19)
Integ tests
should work with dynamic client
passed
0.565s
Integ tests
should work with 'onLogEvent'
passed
2.536s
Integ tests
should work with a sync client
passed
0.733s
Integ tests
should raise an error when appropriate
passed
1.492s
Integ tests
should raise a BAMLValidationError
passed
0.635s
Integ tests
should reset environment variables correctly
passed
1.313s
Integ tests
should use aliases when serializing input objects - classes
passed
1.122s
Integ tests
should use aliases when serializing, but still have original keys in jinja
passed
1.102s
Integ tests
should use aliases when serializing input objects - enums
passed
0.488s
Integ tests
should use aliases when serializing input objects - lists
passed
1.118s
Integ tests
constraints: should handle checks in return types
passed
0.848s
Integ tests
constraints: should handle checks in returned unions
passed
0.95s
Integ tests
constraints: should handle block-level checks
passed
0.809s
Integ tests
constraints: should handle nested-block-level checks
passed
0.77s
\ No newline at end of file