From 823f74c88df3cc7b9ebb4b19b74b5ee6edbafd9c Mon Sep 17 00:00:00 2001 From: Jesus Lizama Date: Sat, 2 Nov 2024 12:23:44 -0500 Subject: [PATCH] Adds missing imports to the sync_client template (#1131) > [!IMPORTANT] > Add missing imports `createBamlValidationError` and `BamlValidationError` to `sync_client.ts.j2` for error handling in `BamlSyncClient`. > > - **Imports**: > - Add `createBamlValidationError` and `BamlValidationError` to the import statement in `sync_client.ts.j2` from `@boundaryml/baml`. > - **Error Handling**: > - Utilize `createBamlValidationError` and `BamlValidationError` in `BamlSyncClient` for error processing. > > This description was created by [Ellipsis](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral) for 94cedb4f41ab3126439c13a5d73be9e610567266. It will automatically update as commits are pushed. --- .../src/typescript/templates/sync_client.ts.j2 | 2 +- integ-tests/typescript/baml_client/sync_client.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 ceeeb15f5..f43ad5cd6 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,4 +1,4 @@ -import { BamlRuntime, FunctionResult, BamlCtxManager, BamlSyncStream, Image, ClientRegistry } from "@boundaryml/baml" +import { BamlRuntime, FunctionResult, BamlCtxManager, BamlSyncStream, Image, ClientRegistry, createBamlValidationError, BamlValidationError } from "@boundaryml/baml" import { {%- for t in types %}{{ t }}{% if !loop.last %}, {% endif %}{% endfor -%} } from "./types" diff --git a/integ-tests/typescript/baml_client/sync_client.ts b/integ-tests/typescript/baml_client/sync_client.ts index d3220200c..fde6a74e6 100644 --- a/integ-tests/typescript/baml_client/sync_client.ts +++ b/integ-tests/typescript/baml_client/sync_client.ts @@ -15,7 +15,7 @@ $ pnpm add @boundaryml/baml // tslint:disable // @ts-nocheck // biome-ignore format: autogenerated code -import { BamlRuntime, FunctionResult, BamlCtxManager, BamlSyncStream, Image, ClientRegistry } from "@boundaryml/baml" +import { BamlRuntime, FunctionResult, BamlCtxManager, BamlSyncStream, Image, ClientRegistry, createBamlValidationError, BamlValidationError } from "@boundaryml/baml" 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"