diff --git a/integ-tests/openapi/baml_client/openapi.yaml b/integ-tests/openapi/baml_client/openapi.yaml index 0de06c1e2..f18751ed8 100644 --- a/integ-tests/openapi/baml_client/openapi.yaml +++ b/integ-tests/openapi/baml_client/openapi.yaml @@ -1276,6 +1276,19 @@ paths: title: ReturnFailingAssertResponse type: integer operationId: ReturnFailingAssert + /call/ReturnJsonEntry: + post: + requestBody: + $ref: '#/components/requestBodies/ReturnJsonEntry' + responses: + '200': + description: Successful operation + content: + application/json: + schema: + title: ReturnJsonEntryResponse + anyOf: [] + operationId: ReturnJsonEntry /call/ReturnMalformedConstraints: post: requestBody: @@ -3663,6 +3676,22 @@ components: required: - inp additionalProperties: false + ReturnJsonEntry: + required: true + content: + application/json: + schema: + title: ReturnJsonEntryRequest + type: object + properties: + s: + type: string + __baml_options__: + nullable: true + $ref: '#/components/schemas/BamlOptions' + required: + - s + additionalProperties: false ReturnMalformedConstraints: required: true content: @@ -6017,6 +6046,14 @@ components: - string_with_twenty_words - three_small_things additionalProperties: false + SimpleTag: + type: object + properties: + field: + type: string + required: + - field + additionalProperties: false SmallThing: type: object properties: diff --git a/integ-tests/python/baml_client/inlinedbaml.py b/integ-tests/python/baml_client/inlinedbaml.py index 951f21ebb..39bdfee90 100644 --- a/integ-tests/python/baml_client/inlinedbaml.py +++ b/integ-tests/python/baml_client/inlinedbaml.py @@ -15,7 +15,7 @@ # fmt: off file_map = { - + "clients.baml": "retry_policy Bar {\n max_retries 3\n strategy {\n type exponential_backoff\n }\n}\n\nretry_policy Foo {\n max_retries 3\n strategy {\n type constant_delay\n delay_ms 100\n }\n}\n\nclient GPT4 {\n provider openai\n options {\n model gpt-4o\n api_key env.OPENAI_API_KEY\n }\n}\n\n\nclient GPT4o {\n provider openai\n options {\n model gpt-4o\n api_key env.OPENAI_API_KEY\n }\n}\n\n\nclient GPT4Turbo {\n retry_policy Bar\n provider openai\n options {\n model gpt-4-turbo\n api_key env.OPENAI_API_KEY\n }\n}\n\nretry_policy GPT4oRetry {\n max_retries 2\n strategy {\n type exponential_backoff\n }\n}\n\nclient GPT35 {\n provider openai\n retry_policy GPT4oRetry\n options {\n model \"gpt-4o-mini\"\n api_key env.OPENAI_API_KEY\n }\n}\n\nclient GPT35LegacyProvider {\n provider openai\n options {\n model \"gpt-3.5-turbo\"\n api_key env.OPENAI_API_KEY\n }\n}\n\n\nclient Ollama {\n provider ollama\n options {\n model llama2\n }\n}\n\nclient GPT35Azure {\n provider azure-openai\n options {\n resource_name \"west-us-azure-baml\"\n deployment_id \"gpt-35-turbo-default\"\n // base_url \"https://west-us-azure-baml.openai.azure.com/openai/deployments/gpt-35-turbo-default\"\n api_version \"2024-02-01\"\n api_key env.AZURE_OPENAI_API_KEY\n }\n}\n\n// Azure O1 client without max_tokens (should not add default)\nclient AzureO1 {\n provider azure-openai\n options {\n resource_name \"west-us-azure-baml\"\n deployment_id \"o1-mini\"\n api_version \"2024-08-01-preview\"\n api_key env.AZURE_OPENAI_API_KEY\n max_tokens null\n }\n}\n\n// Azure O1 client with explicit max_tokens (should keep user value)\nclient AzureO1WithMaxTokens {\n provider azure-openai\n options {\n resource_name \"west-us-azure-baml\"\n deployment_id \"o1-mini\"\n api_version \"2024-08-01-preview\"\n api_key env.AZURE_OPENAI_API_KEY\n max_tokens 1000\n }\n}\n\nclient AzureO1WithMaxCompletionTokens {\n provider azure-openai\n options {\n resource_name \"west-us-azure-baml\"\n deployment_id \"o1-mini\"\n api_version \"2024-08-01-preview\"\n api_key env.AZURE_OPENAI_API_KEY\n max_completion_tokens 1000\n }\n}\n\n// Azure GPT-35 client with explicit max_tokens (should keep user value)\nclient GPT35AzureWithMaxTokens {\n provider azure-openai\n options {\n resource_name \"west-us-azure-baml\"\n deployment_id \"gpt-35-turbo-default\"\n api_version \"2024-02-01\"\n api_key env.AZURE_OPENAI_API_KEY\n max_tokens 1000\n }\n}\n\n// Azure client with invalid resource name (for testing failures)\nclient GPT35AzureFailed {\n provider azure-openai\n options {\n resource_name \"west-us-azure-baml-incorrect-suffix\"\n deployment_id \"gpt-35-turbo-default\"\n api_key env.AZURE_OPENAI_API_KEY\n }\n}\n\nclient Gemini {\n provider google-ai\n options {\n model gemini-1.5-pro-001\n api_key env.GOOGLE_API_KEY\n safetySettings {\n category HARM_CATEGORY_HATE_SPEECH\n threshold BLOCK_LOW_AND_ABOVE\n }\n }\n}\n\nclient GeminiOpenAiGeneric {\n provider \"openai-generic\"\n options {\n base_url \"https://generativelanguage.googleapis.com/v1beta/\"\n model \"gemini-1.5-flash\"\n api_key env.GOOGLE_API_KEY\n }\n}\n\nclient Vertex {\n provider vertex-ai\n options {\n model gemini-1.5-pro\n location us-central1\n credentials env.INTEG_TESTS_GOOGLE_APPLICATION_CREDENTIALS_CONTENT\n }\n}\n\n\nclient AwsBedrock {\n provider aws-bedrock\n options {\n inference_configuration {\n max_tokens 100\n }\n // model \"anthropic.claude-3-5-sonnet-20240620-v1:0\"\n // model_id \"anthropic.claude-3-haiku-20240307-v1:0\"\n model \"meta.llama3-8b-instruct-v1:0\"\n // region \"us-east-1\"\n // access_key_id env.AWS_ACCESS_KEY_ID\n // secret_access_key env.AWS_SECRET_ACCESS_KEY\n // session_token env.AWS_SESSION_TOKEN\n // session_token null\n // model_id \"mistral.mistral-7b-instruct-v0:2\"\n }\n}\n\nclient AwsBedrockInvalidRegion {\n provider aws-bedrock\n options {\n region \"us-invalid-7\"\n inference_configuration {\n max_tokens 100\n }\n // model \"anthropic.claude-3-5-sonnet-20240620-v1:0\"\n // model_id \"anthropic.claude-3-haiku-20240307-v1:0\"\n model_id \"meta.llama3-8b-instruct-v1:0\"\n // model_id \"mistral.mistral-7b-instruct-v0:2\"\n }\n}\n\nclient AwsBedrockInvalidAccessKey {\n provider aws-bedrock\n options {\n model_id \"meta.llama3-8b-instruct-v1:0\"\n access_key_id \"AKIAINVALID12345678\"\n secret_access_key \"abcdef1234567890abcdef1234567890abcdef12\"\n inference_configuration {\n max_tokens 100\n }\n }\n}\n\nclient AwsBedrockInvalidProfile {\n provider aws-bedrock\n options {\n model_id \"meta.llama3-8b-instruct-v1:0\"\n profile \"invalid-profile\"\n inference_configuration {\n max_tokens 100\n }\n }\n}\n\nclient AwsBedrockInvalidSessionToken {\n provider aws-bedrock\n options {\n model_id \"meta.llama3-8b-instruct-v1:0\"\n region \"us-east-1\"\n access_key_id \"AKIAINVALID12345678\"\n secret_access_key \"abcdef1234567890abcdef1234567890abcdef12\"\n session_token \"invalid-session-token\"\n inference_configuration {\n max_tokens 100\n }\n }\n}\n\n\nclient Invalid{\n provider aws-bedrock\n options {\n model_id \"meta.llama3-8b-instruct-v1:0\"\n region \"us-east-1\"\n access_key_id \"AKIAINVALID12345678\"\n secret_access_key \"abcdef1234567890abcdef1234567890abcdef12\"\n session_token \"invalid-session-token\"\n inference_configuration {\n max_tokens 100\n }\n }\n}\n\nclient Sonnet {\n provider anthropic\n options {\n model claude-3-5-sonnet-20241022\n api_key env.ANTHROPIC_API_KEY\n }\n}\n\nclient Claude {\n provider anthropic\n options {\n model claude-3-haiku-20240307\n api_key env.ANTHROPIC_API_KEY\n max_tokens 1000\n }\n}\n\nclient ClaudeWithCaching {\n provider anthropic\n options {\n model claude-3-haiku-20240307\n api_key env.ANTHROPIC_API_KEY\n max_tokens 500\n allowed_role_metadata [\"cache_control\"]\n headers {\n \"anthropic-beta\" \"prompt-caching-2024-07-31\"\n }\n }\n}\n\nclient Resilient_SimpleSyntax {\n retry_policy Foo\n provider baml-fallback\n options {\n strategy [\n GPT4Turbo\n GPT35\n Lottery_SimpleSyntax\n ]\n }\n}\n\nclient Lottery_SimpleSyntax {\n provider baml-round-robin\n options {\n start 0\n strategy [\n GPT35\n Claude\n ]\n }\n}\n\nclient TogetherAi {\n provider \"openai-generic\"\n options {\n base_url \"https://api.together.ai/v1\"\n api_key env.TOGETHER_API_KEY\n model \"meta-llama/Llama-3-70b-chat-hf\"\n }\n}\n\n// OpenAI O1 client without max_tokens (should not add default)\nclient OpenAIO1 {\n provider openai\n options {\n model \"o1-mini\"\n api_key env.OPENAI_API_KEY\n }\n}\n\n// OpenAI O1 client with explicit max_tokens (should fail)\nclient OpenAIO1WithMaxTokens {\n provider openai\n options {\n model \"o1-mini\"\n api_key env.OPENAI_API_KEY\n max_tokens 1000\n }\n}\n\n// OpenAI O1 client with explicit max_completion_tokens\nclient OpenAIO1WithMaxCompletionTokens {\n provider openai\n options {\n model \"o1-mini\"\n api_key env.OPENAI_API_KEY\n max_completion_tokens 1000\n }\n}\n\n// OpenAI GPT-4 client with explicit max_tokens\nclient GPT4WithMaxTokens {\n provider openai\n options {\n model \"gpt-4\"\n api_key env.OPENAI_API_KEY\n max_tokens 1000\n }\n}\n", "custom-task.baml": "class BookOrder {\n orderId string @description(#\"\n The ID of the book order\n \"#)\n title string @description(#\"\n The title of the ordered book\n \"#)\n quantity int @description(#\"\n The quantity of books ordered\n \"#)\n price float @description(#\"\n The price of the book\n \"#)\n}\n\nclass FlightConfirmation {\n confirmationNumber string @description(#\"\n The flight confirmation number\n \"#)\n flightNumber string @description(#\"\n The flight number\n \"#)\n departureTime string @description(#\"\n The scheduled departure time of the flight\n \"#)\n arrivalTime string @description(#\"\n The scheduled arrival time of the flight\n \"#)\n seatNumber string @description(#\"\n The seat number assigned on the flight\n \"#)\n}\n\nclass GroceryReceipt {\n receiptId string @description(#\"\n The ID of the grocery receipt\n \"#)\n storeName string @description(#\"\n The name of the grocery store\n \"#)\n items (string | int | float)[] @description(#\"\n A list of items purchased. Each item consists of a name, quantity, and price.\n \"#)\n totalAmount float @description(#\"\n The total amount spent on groceries\n \"#)\n}\n\nclass CustomTaskResult {\n bookOrder BookOrder | null\n flightConfirmation FlightConfirmation | null\n groceryReceipt GroceryReceipt | null\n}\n\nfunction CustomTask(input: string) -> BookOrder | FlightConfirmation | GroceryReceipt {\n client \"openai/gpt-4o-mini\"\n prompt #\"\n Given the input string, extract either an order for a book, a flight confirmation, or a grocery receipt.\n\n {{ ctx.output_format }}\n\n Input:\n \n {{ input}}\n \"#\n}\n\ntest CustomTask {\n functions [CustomTask]\n args {\n input #\"\nDear [Your Name],\n\nThank you for booking with [Airline Name]! We are pleased to confirm your upcoming flight.\n\nFlight Confirmation Details:\n\nBooking Reference: ABC123\nPassenger Name: [Your Name]\nFlight Number: XY789\nDeparture Date: September 15, 2024\nDeparture Time: 10:30 AM\nArrival Time: 1:45 PM\nDeparture Airport: John F. Kennedy International Airport (JFK), New York, NY\nArrival Airport: Los Angeles International Airport (LAX), Los Angeles, CA\nSeat Number: 12A\nClass: Economy\nBaggage Allowance:\n\nChecked Baggage: 1 piece, up to 23 kg\nCarry-On Baggage: 1 piece, up to 7 kg\nImportant Information:\n\nPlease arrive at the airport at least 2 hours before your scheduled departure.\nCheck-in online via our website or mobile app to save time at the airport.\nEnsure that your identification documents are up to date and match the name on your booking.\nContact Us:\n\nIf you have any questions or need to make changes to your booking, please contact our customer service team at 1-800-123-4567 or email us at support@[airline].com.\n\nWe wish you a pleasant journey and thank you for choosing [Airline Name].\n\nBest regards,\n\n[Airline Name] Customer Service\n \"#\n }\n}", "fiddle-examples/chain-of-thought.baml": "class Email {\n subject string\n body string\n from_address string\n}\n\nenum OrderStatus {\n ORDERED\n SHIPPED\n DELIVERED\n CANCELLED\n}\n\nclass OrderInfo {\n order_status OrderStatus\n tracking_number string?\n estimated_arrival_date string?\n}\n\nfunction GetOrderInfo(email: Email) -> OrderInfo {\n client GPT4\n prompt #\"\n Given the email below:\n\n ```\n from: {{email.from_address}}\n Email Subject: {{email.subject}}\n Email Body: {{email.body}}\n ```\n\n Extract this info from the email in JSON format:\n {{ ctx.output_format }}\n\n Before you output the JSON, please explain your\n reasoning step-by-step. Here is an example on how to do this:\n 'If we think step by step we can see that ...\n therefore the output JSON is:\n {\n ... the json schema ...\n }'\n \"#\n}", diff --git a/integ-tests/python/baml_client/type_builder.py b/integ-tests/python/baml_client/type_builder.py index 7291226b4..7833b4507 100644 --- a/integ-tests/python/baml_client/type_builder.py +++ b/integ-tests/python/baml_client/type_builder.py @@ -20,55 +20,55 @@ class TypeBuilder(_TypeBuilder): def __init__(self): super().__init__(classes=set( - ["AnotherObject","BigNumbers","BinaryNode","Blah","BlockConstraint","BlockConstraintForParam","BookOrder","ClassForNullLiteral","ClassOptionalOutput","ClassOptionalOutput2","ClassToRecAlias","ClassWithBlockDone","ClassWithImage","ClassWithoutDone","ComplexMemoryObject","CompoundBigNumbers","ContactInfo","CustomTaskResult","DummyOutput","DynInputOutput","DynamicClassOne","DynamicClassTwo","DynamicOutput","Earthling","Education","Email","EmailAddress","Event","FakeImage","FlightConfirmation","FooAny","Forest","FormatterTest0","FormatterTest1","FormatterTest2","FormatterTest3","GroceryReceipt","InnerClass","InnerClass2","InputClass","InputClassNested","LinkedList","LinkedListAliasNode","LiteralClassHello","LiteralClassOne","LiteralClassTwo","MalformedConstraints","MalformedConstraints2","Martian","MemoryObject","MergeAttrs","NamedArgsSingleClass","Nested","Nested2","NestedBlockConstraint","NestedBlockConstraintForParam","Node","NodeWithAliasIndirection","OptionalListAndMap","OptionalTest_Prop1","OptionalTest_ReturnType","OrderInfo","OriginalA","OriginalB","Person","PhoneNumber","Quantity","RaysData","ReceiptInfo","ReceiptItem","Recipe","RecursiveAliasDependency","Resume","Schema","SearchParams","SemanticContainer","SmallThing","SomeClassNestedDynamic","StringToClassEntry","TestClassAlias","TestClassNested","TestClassWithEnum","TestMemoryOutput","TestOutputClass","Tree","TwoStoriesOneTitle","UnionTest_ReturnType","UniverseQuestion","UniverseQuestionInput","WithReasoning",] + ["AnotherObject","BigNumbers","BinaryNode","Blah","BlockConstraint","BlockConstraintForParam","BookOrder","ClassForNullLiteral","ClassOptionalOutput","ClassOptionalOutput2","ClassToRecAlias","ClassWithBlockDone","ClassWithImage","ClassWithoutDone","ComplexMemoryObject","CompoundBigNumbers","ContactInfo","CustomTaskResult","DummyOutput","DynInputOutput","DynamicClassOne","DynamicClassTwo","DynamicOutput","Earthling","Education","Email","EmailAddress","Event","FakeImage","FlightConfirmation","FooAny","Forest","FormatterTest0","FormatterTest1","FormatterTest2","FormatterTest3","GroceryReceipt","InnerClass","InnerClass2","InputClass","InputClassNested","LinkedList","LinkedListAliasNode","LiteralClassHello","LiteralClassOne","LiteralClassTwo","MalformedConstraints","MalformedConstraints2","Martian","MemoryObject","MergeAttrs","NamedArgsSingleClass","Nested","Nested2","NestedBlockConstraint","NestedBlockConstraintForParam","Node","NodeWithAliasIndirection","OptionalListAndMap","OptionalTest_Prop1","OptionalTest_ReturnType","OrderInfo","OriginalA","OriginalB","Person","PhoneNumber","Quantity","RaysData","ReceiptInfo","ReceiptItem","Recipe","RecursiveAliasDependency","Resume","Schema","SearchParams","SemanticContainer","SimpleTag","SmallThing","SomeClassNestedDynamic","StringToClassEntry","TestClassAlias","TestClassNested","TestClassWithEnum","TestMemoryOutput","TestOutputClass","Tree","TwoStoriesOneTitle","UnionTest_ReturnType","UniverseQuestion","UniverseQuestionInput","WithReasoning",] ), enums=set( ["AliasedEnum","Category","Category2","Category3","Color","DataType","DynEnumOne","DynEnumTwo","EnumInClass","EnumOutput","Hobby","MapKey","NamedArgsSingleEnum","NamedArgsSingleEnumList","OptionalTest_CategoryType","OrderStatus","Tag","TestEnum",] )) - + @property def DummyOutput(self) -> "DummyOutputBuilder": return DummyOutputBuilder(self) - + @property def DynInputOutput(self) -> "DynInputOutputBuilder": return DynInputOutputBuilder(self) - + @property def DynamicClassOne(self) -> "DynamicClassOneBuilder": return DynamicClassOneBuilder(self) - + @property def DynamicClassTwo(self) -> "DynamicClassTwoBuilder": return DynamicClassTwoBuilder(self) - + @property def DynamicOutput(self) -> "DynamicOutputBuilder": return DynamicOutputBuilder(self) - + @property def OriginalB(self) -> "OriginalBBuilder": return OriginalBBuilder(self) - + @property def Person(self) -> "PersonBuilder": return PersonBuilder(self) - + @property def SomeClassNestedDynamic(self) -> "SomeClassNestedDynamicBuilder": return SomeClassNestedDynamicBuilder(self) @@ -110,7 +110,7 @@ def type(self) -> FieldType: @property def props(self) -> "DummyOutputProperties": return self.__props - + def list_properties(self) -> typing.List[typing.Tuple[str, ClassPropertyBuilder]]: return [(name, ClassPropertyBuilder(self.__bldr.property(name))) for name in self.__properties] @@ -124,7 +124,7 @@ def __init__(self, cls_bldr: ClassBuilder, properties: typing.Set[str]): self.__bldr = cls_bldr self.__properties = properties - + @property def nonce(self) -> ClassPropertyBuilder: @@ -152,7 +152,7 @@ def type(self) -> FieldType: @property def props(self) -> "DynInputOutputProperties": return self.__props - + def list_properties(self) -> typing.List[typing.Tuple[str, ClassPropertyBuilder]]: return [(name, ClassPropertyBuilder(self.__bldr.property(name))) for name in self.__properties] @@ -166,7 +166,7 @@ def __init__(self, cls_bldr: ClassBuilder, properties: typing.Set[str]): self.__bldr = cls_bldr self.__properties = properties - + @property def testKey(self) -> ClassPropertyBuilder: @@ -190,7 +190,7 @@ def type(self) -> FieldType: @property def props(self) -> "DynamicClassOneProperties": return self.__props - + def list_properties(self) -> typing.List[typing.Tuple[str, ClassPropertyBuilder]]: return [(name, ClassPropertyBuilder(self.__bldr.property(name))) for name in self.__properties] @@ -204,7 +204,7 @@ def __init__(self, cls_bldr: ClassBuilder, properties: typing.Set[str]): self.__bldr = cls_bldr self.__properties = properties - + def __getattr__(self, name: str) -> ClassPropertyBuilder: if name not in self.__properties: @@ -224,7 +224,7 @@ def type(self) -> FieldType: @property def props(self) -> "DynamicClassTwoProperties": return self.__props - + def list_properties(self) -> typing.List[typing.Tuple[str, ClassPropertyBuilder]]: return [(name, ClassPropertyBuilder(self.__bldr.property(name))) for name in self.__properties] @@ -238,7 +238,7 @@ def __init__(self, cls_bldr: ClassBuilder, properties: typing.Set[str]): self.__bldr = cls_bldr self.__properties = properties - + @property def hi(self) -> ClassPropertyBuilder: @@ -270,7 +270,7 @@ def type(self) -> FieldType: @property def props(self) -> "DynamicOutputProperties": return self.__props - + def list_properties(self) -> typing.List[typing.Tuple[str, ClassPropertyBuilder]]: return [(name, ClassPropertyBuilder(self.__bldr.property(name))) for name in self.__properties] @@ -284,7 +284,7 @@ def __init__(self, cls_bldr: ClassBuilder, properties: typing.Set[str]): self.__bldr = cls_bldr self.__properties = properties - + def __getattr__(self, name: str) -> ClassPropertyBuilder: if name not in self.__properties: @@ -304,7 +304,7 @@ def type(self) -> FieldType: @property def props(self) -> "OriginalBProperties": return self.__props - + def list_properties(self) -> typing.List[typing.Tuple[str, ClassPropertyBuilder]]: return [(name, ClassPropertyBuilder(self.__bldr.property(name))) for name in self.__properties] @@ -318,7 +318,7 @@ def __init__(self, cls_bldr: ClassBuilder, properties: typing.Set[str]): self.__bldr = cls_bldr self.__properties = properties - + @property def value(self) -> ClassPropertyBuilder: @@ -342,7 +342,7 @@ def type(self) -> FieldType: @property def props(self) -> "PersonProperties": return self.__props - + def list_properties(self) -> typing.List[typing.Tuple[str, ClassPropertyBuilder]]: return [(name, ClassPropertyBuilder(self.__bldr.property(name))) for name in self.__properties] @@ -356,7 +356,7 @@ def __init__(self, cls_bldr: ClassBuilder, properties: typing.Set[str]): self.__bldr = cls_bldr self.__properties = properties - + @property def name(self) -> ClassPropertyBuilder: @@ -384,7 +384,7 @@ def type(self) -> FieldType: @property def props(self) -> "SomeClassNestedDynamicProperties": return self.__props - + def list_properties(self) -> typing.List[typing.Tuple[str, ClassPropertyBuilder]]: return [(name, ClassPropertyBuilder(self.__bldr.property(name))) for name in self.__properties] @@ -398,7 +398,7 @@ def __init__(self, cls_bldr: ClassBuilder, properties: typing.Set[str]): self.__bldr = cls_bldr self.__properties = properties - + @property def hi(self) -> ClassPropertyBuilder: @@ -440,37 +440,37 @@ def __init__(self, enum_bldr: EnumBuilder, values: typing.Set[str]): self.__bldr = enum_bldr self.__values = values - + @property def RED(self) -> EnumValueBuilder: return self.__bldr.value("RED") - + @property def BLUE(self) -> EnumValueBuilder: return self.__bldr.value("BLUE") - + @property def GREEN(self) -> EnumValueBuilder: return self.__bldr.value("GREEN") - + @property def YELLOW(self) -> EnumValueBuilder: return self.__bldr.value("YELLOW") - + @property def BLACK(self) -> EnumValueBuilder: return self.__bldr.value("BLACK") - + @property def WHITE(self) -> EnumValueBuilder: return self.__bldr.value("WHITE") - + def __getattr__(self, name: str) -> EnumValueBuilder: if name not in self.__values: @@ -505,7 +505,7 @@ def __init__(self, enum_bldr: EnumBuilder, values: typing.Set[str]): self.__bldr = enum_bldr self.__values = values - + def __getattr__(self, name: str) -> EnumValueBuilder: if name not in self.__values: @@ -540,7 +540,7 @@ def __init__(self, enum_bldr: EnumBuilder, values: typing.Set[str]): self.__bldr = enum_bldr self.__values = values - + def __getattr__(self, name: str) -> EnumValueBuilder: if name not in self.__values: @@ -575,22 +575,22 @@ def __init__(self, enum_bldr: EnumBuilder, values: typing.Set[str]): self.__bldr = enum_bldr self.__values = values - + @property def SPORTS(self) -> EnumValueBuilder: return self.__bldr.value("SPORTS") - + @property def MUSIC(self) -> EnumValueBuilder: return self.__bldr.value("MUSIC") - + @property def READING(self) -> EnumValueBuilder: return self.__bldr.value("READING") - + def __getattr__(self, name: str) -> EnumValueBuilder: if name not in self.__values: diff --git a/integ-tests/react/baml_client/async_client.ts b/integ-tests/react/baml_client/async_client.ts index 94f5f20dd..052b3215f 100644 --- a/integ-tests/react/baml_client/async_client.ts +++ b/integ-tests/react/baml_client/async_client.ts @@ -18,7 +18,7 @@ $ pnpm add @boundaryml/baml import { type BamlCtxManager, type BamlRuntime, BamlStream, BamlValidationError, type ClientRegistry, FunctionResult, type Image, createBamlValidationError } from "@boundaryml/baml" import type { Checked, Check, RecursivePartialNull as MovedRecursivePartialNull } from "./types" import type { partial_types } from "./partial_types"; -import type {AliasedEnum, AnotherObject, BigNumbers, BinaryNode, Blah, BlockConstraint, BlockConstraintForParam, BookOrder, Category, Category2, Category3, ClassForNullLiteral, ClassOptionalOutput, ClassOptionalOutput2, ClassToRecAlias, ClassWithBlockDone, ClassWithImage, ClassWithoutDone, Color, ComplexMemoryObject, CompoundBigNumbers, ContactInfo, CustomTaskResult, DataType, DummyOutput, DynEnumOne, DynEnumTwo, DynInputOutput, DynamicClassOne, DynamicClassTwo, DynamicOutput, Earthling, Education, Email, EmailAddress, EnumInClass, EnumOutput, Event, FakeImage, FlightConfirmation, FooAny, Forest, FormatterTest0, FormatterTest1, FormatterTest2, FormatterTest3, GroceryReceipt, Hobby, InnerClass, InnerClass2, InputClass, InputClassNested, JsonArray, JsonObject, JsonValue, LinkedList, LinkedListAliasNode, LiteralClassHello, LiteralClassOne, LiteralClassTwo, MalformedConstraints, MalformedConstraints2, MapKey, Martian, MemoryObject, MergeAttrs, NamedArgsSingleClass, NamedArgsSingleEnum, NamedArgsSingleEnumList, Nested, Nested2, NestedBlockConstraint, NestedBlockConstraintForParam, Node, NodeWithAliasIndirection, OptionalListAndMap, OptionalTest_CategoryType, OptionalTest_Prop1, OptionalTest_ReturnType, OrderInfo, OrderStatus, OriginalA, OriginalB, Person, PhoneNumber, Quantity, RaysData, RecAliasOne, RecAliasThree, RecAliasTwo, ReceiptInfo, ReceiptItem, Recipe, RecursiveAliasDependency, RecursiveListAlias, RecursiveMapAlias, Resume, Schema, SearchParams, SemanticContainer, SmallThing, SomeClassNestedDynamic, StringToClassEntry, Tag, TestClassAlias, TestClassNested, TestClassWithEnum, TestEnum, TestMemoryOutput, TestOutputClass, Tree, TwoStoriesOneTitle, UnionTest_ReturnType, UniverseQuestion, UniverseQuestionInput, WithReasoning} from "./types" +import type {AliasedEnum, AnotherObject, BigNumbers, BinaryNode, Blah, BlockConstraint, BlockConstraintForParam, BookOrder, Category, Category2, Category3, ClassForNullLiteral, ClassOptionalOutput, ClassOptionalOutput2, ClassToRecAlias, ClassWithBlockDone, ClassWithImage, ClassWithoutDone, Color, ComplexMemoryObject, CompoundBigNumbers, ContactInfo, CustomTaskResult, DataType, DummyOutput, DynEnumOne, DynEnumTwo, DynInputOutput, DynamicClassOne, DynamicClassTwo, DynamicOutput, Earthling, Education, Email, EmailAddress, EnumInClass, EnumOutput, Event, FakeImage, FlightConfirmation, FooAny, Forest, FormatterTest0, FormatterTest1, FormatterTest2, FormatterTest3, GroceryReceipt, Hobby, InnerClass, InnerClass2, InputClass, InputClassNested, JsonArray, JsonEntry, JsonObject, JsonTemplate, JsonValue, LinkedList, LinkedListAliasNode, LiteralClassHello, LiteralClassOne, LiteralClassTwo, MalformedConstraints, MalformedConstraints2, MapKey, Martian, MemoryObject, MergeAttrs, NamedArgsSingleClass, NamedArgsSingleEnum, NamedArgsSingleEnumList, Nested, Nested2, NestedBlockConstraint, NestedBlockConstraintForParam, Node, NodeWithAliasIndirection, OptionalListAndMap, OptionalTest_CategoryType, OptionalTest_Prop1, OptionalTest_ReturnType, OrderInfo, OrderStatus, OriginalA, OriginalB, Person, PhoneNumber, Quantity, RaysData, RecAliasOne, RecAliasThree, RecAliasTwo, ReceiptInfo, ReceiptItem, Recipe, RecursiveAliasDependency, RecursiveListAlias, RecursiveMapAlias, Resume, Schema, SearchParams, SemanticContainer, SimpleTag, SmallThing, SomeClassNestedDynamic, StringToClassEntry, Tag, TestClassAlias, TestClassNested, TestClassWithEnum, TestEnum, TestMemoryOutput, TestOutputClass, Tree, TwoStoriesOneTitle, UnionTest_ReturnType, UniverseQuestion, UniverseQuestionInput, WithReasoning} from "./types" import type 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" @@ -2243,6 +2243,31 @@ export class BamlAsyncClient { } } + async ReturnJsonEntry( + s: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Promise { + try { + const raw = await this.runtime.callFunction( + "ReturnJsonEntry", + { + "s": s + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as JsonTemplate + } catch (error: any) { + const bamlError = createBamlValidationError(error); + if (bamlError instanceof BamlValidationError) { + throw bamlError; + } + + throw error; + } + } + async ReturnMalformedConstraints( a: number, __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } @@ -6853,6 +6878,39 @@ class BamlStreamClient { } } + ReturnJsonEntry( + s: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): BamlStream { + try { + const raw = this.runtime.streamFunction( + "ReturnJsonEntry", + { + "s": s + }, + undefined, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return new BamlStream( + raw, + (a): a is JsonTemplate => a, + (a): a is JsonTemplate => a, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + ) + } catch (error) { + if (error instanceof Error) { + const bamlError = createBamlValidationError(error); + if (bamlError instanceof BamlValidationError) { + throw bamlError; + } + } + throw error; + } + } + ReturnMalformedConstraints( a: number, __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } diff --git a/integ-tests/react/baml_client/inlinedbaml.ts b/integ-tests/react/baml_client/inlinedbaml.ts index 39013d7f2..c5f7fffd3 100644 --- a/integ-tests/react/baml_client/inlinedbaml.ts +++ b/integ-tests/react/baml_client/inlinedbaml.ts @@ -84,7 +84,7 @@ const fileMap = { "test-files/functions/output/optional-class.baml": "class ClassOptionalOutput {\n prop1 string\n prop2 string\n}\n\nfunction FnClassOptionalOutput(input: string) -> ClassOptionalOutput? {\n client GPT35\n prompt #\"\n Return a json blob for the following input:\n {{input}}\n\n {{ctx.output_format}}\n\n JSON:\n \"#\n}\n\n\nclass Blah {\n prop4 string?\n}\n\nclass ClassOptionalOutput2 {\n prop1 string?\n prop2 string?\n prop3 Blah?\n}\n\nfunction FnClassOptionalOutput2(input: string) -> ClassOptionalOutput2? {\n client GPT35\n prompt #\"\n Return a json blob for the following input:\n {{input}}\n\n {{ctx.output_format}}\n\n JSON:\n \"#\n}\n\ntest FnClassOptionalOutput2 {\n functions [FnClassOptionalOutput2, FnClassOptionalOutput]\n args {\n input \"example input\"\n }\n}\n", "test-files/functions/output/optional.baml": "class OptionalTest_Prop1 {\n omega_a string\n omega_b int\n}\n\nenum OptionalTest_CategoryType {\n Aleph\n Beta\n Gamma\n}\n \nclass OptionalTest_ReturnType {\n omega_1 OptionalTest_Prop1?\n omega_2 string?\n omega_3 (OptionalTest_CategoryType?)[]\n} \n \nfunction OptionalTest_Function(input: string) -> (OptionalTest_ReturnType?)[]\n{ \n client GPT35\n prompt #\"\n Return a JSON blob with this schema: \n {{ctx.output_format}}\n\n JSON:\n \"#\n}\n\ntest OptionalTest_Function {\n functions [OptionalTest_Function]\n args {\n input \"example input\"\n }\n}\n", "test-files/functions/output/recursive-class.baml": "class Node {\n data int\n next Node?\n}\n\nclass LinkedList {\n head Node?\n len int\n}\n\nclient O1 {\n provider \"openai\"\n options {\n model \"o1-mini\"\n default_role \"user\"\n }\n}\n\nfunction BuildLinkedList(input: int[]) -> LinkedList {\n client O1\n prompt #\"\n Build a linked list from the input array of integers.\n\n INPUT:\n {{ input }}\n\n {{ ctx.output_format }} \n \"#\n}\n\ntest TestLinkedList {\n functions [BuildLinkedList]\n args {\n input [1, 2, 3, 4, 5]\n }\n}\n", - "test-files/functions/output/recursive-type-aliases.baml": "class LinkedListAliasNode {\n value int\n next LinkedListAliasNode?\n}\n\n// Simple alias that points to recursive type.\ntype LinkedListAlias = LinkedListAliasNode\n\nfunction AliasThatPointsToRecursiveType(list: LinkedListAlias) -> LinkedListAlias {\n client \"openai/gpt-4o\"\n prompt r#\"\n Return the given linked list back:\n \n {{ list }}\n \n {{ ctx.output_format }}\n \"#\n}\n\n// Class that points to an alias that points to a recursive type.\nclass ClassToRecAlias {\n list LinkedListAlias\n}\n\nfunction ClassThatPointsToRecursiveClassThroughAlias(cls: ClassToRecAlias) -> ClassToRecAlias {\n client \"openai/gpt-4o\"\n prompt r#\"\n Return the given object back:\n \n {{ cls }}\n \n {{ ctx.output_format }}\n \"#\n}\n\n// This is tricky cause this class should be hoisted, but classes and aliases\n// are two different types in the AST. This test will make sure they can interop.\nclass NodeWithAliasIndirection {\n value int\n next NodeIndirection?\n}\n\ntype NodeIndirection = NodeWithAliasIndirection\n\nfunction RecursiveClassWithAliasIndirection(cls: NodeWithAliasIndirection) -> NodeWithAliasIndirection {\n client \"openai/gpt-4o\"\n prompt r#\"\n Return the given object back:\n \n {{ cls }}\n \n {{ ctx.output_format }}\n \"#\n}\n", + "test-files/functions/output/recursive-type-aliases.baml": "class LinkedListAliasNode {\n value int\n next LinkedListAliasNode?\n}\n\n// Simple alias that points to recursive type.\ntype LinkedListAlias = LinkedListAliasNode\n\nfunction AliasThatPointsToRecursiveType(list: LinkedListAlias) -> LinkedListAlias {\n client \"openai/gpt-4o\"\n prompt r#\"\n Return the given linked list back:\n\n {{ list }}\n\n {{ ctx.output_format }}\n \"#\n}\n\n// Class that points to an alias that points to a recursive type.\nclass ClassToRecAlias {\n list LinkedListAlias\n}\n\nfunction ClassThatPointsToRecursiveClassThroughAlias(cls: ClassToRecAlias) -> ClassToRecAlias {\n client \"openai/gpt-4o\"\n prompt r#\"\n Return the given object back:\n\n {{ cls }}\n\n {{ ctx.output_format }}\n \"#\n}\n\n// This is tricky cause this class should be hoisted, but classes and aliases\n// are two different types in the AST. This test will make sure they can interop.\nclass NodeWithAliasIndirection {\n value int\n next NodeIndirection?\n}\n\ntype NodeIndirection = NodeWithAliasIndirection\n\nfunction RecursiveClassWithAliasIndirection(cls: NodeWithAliasIndirection) -> NodeWithAliasIndirection {\n client \"openai/gpt-4o\"\n prompt r#\"\n Return the given object back:\n\n {{ cls }}\n\n {{ ctx.output_format }}\n \"#\n}\n\ntype JsonEntry = SimpleTag | JsonTemplate\n\ntype JsonTemplate = map\n\nclass SimpleTag {\n field string\n}\n\nfunction ReturnJsonEntry(s: string) -> JsonTemplate {\n client GPT4o\n prompt #\"\n {{ _.role(\"user\") }}\n\n Extract info from this string:\n {{ s }}\n\n {{ ctx.output_format }}\n \"#\n}\n", "test-files/functions/output/serialization-error.baml": "class DummyOutput {\n nonce string\n nonce2 string\n @@dynamic\n}\n\nfunction DummyOutputFunction(input: string) -> DummyOutput {\n client GPT35\n prompt #\"\n Say \"hello there\".\n \"#\n}", "test-files/functions/output/string-list.baml": "function FnOutputStringList(input: string) -> string[] {\n client GPT35\n prompt #\"\n Return a list of strings in json format like [\"string1\", \"string2\", \"string3\"].\n\n JSON:\n \"#\n}\n\ntest FnOutputStringList {\n functions [FnOutputStringList]\n args {\n input \"example input\"\n }\n}\n", "test-files/functions/output/type-aliases.baml": "type Primitive = int | string | bool | float\n\ntype List = string[]\n\ntype Graph = map\n\ntype Combination = Primitive | List | Graph\n\nfunction PrimitiveAlias(p: Primitive) -> Primitive {\n client \"openai/gpt-4o\"\n prompt r#\"\n Return the given value back: {{ p }}\n \"#\n}\n\nfunction MapAlias(m: Graph) -> Graph {\n client \"openai/gpt-4o\"\n prompt r#\"\n Return the given Graph back:\n\n {{ m }}\n\n {{ ctx.output_format }}\n \"#\n}\n\nfunction NestedAlias(c: Combination) -> Combination {\n client \"openai/gpt-4o\"\n prompt r#\"\n Return the given value back:\n\n {{ c }}\n\n {{ ctx.output_format }}\n \"#\n}\n\n// Test attribute merging.\ntype Currency = int @check(gt_ten, {{ this > 10 }})\ntype Amount = Currency @assert({{ this > 0 }})\n\nclass MergeAttrs {\n amount Amount @description(\"In USD\")\n}\n\n// This should be allowed.\ntype MultipleAttrs = int @assert({{ this > 0 }}) @check(gt_ten, {{ this > 10 }})\n\nfunction MergeAliasAttributes(money: int) -> MergeAttrs {\n client \"openai/gpt-4o\"\n prompt r#\"\n Return the given integer in the specified format:\n\n {{ money }}\n\n {{ ctx.output_format }}\n \"#\n}\n\nfunction ReturnAliasWithMergedAttributes(money: Amount) -> Amount {\n client \"openai/gpt-4o\"\n prompt r#\"\n Return the given integer without additional context:\n\n {{ money }}\n\n {{ ctx.output_format }}\n \"#\n}\n\nfunction AliasWithMultipleAttrs(money: MultipleAttrs) -> MultipleAttrs {\n client \"openai/gpt-4o\"\n prompt r#\"\n Return the given integer without additional context:\n\n {{ money }}\n\n {{ ctx.output_format }}\n \"#\n}\n\ntype RecursiveMapAlias = map\n\nfunction SimpleRecursiveMapAlias(input: RecursiveMapAlias) -> RecursiveMapAlias {\n client \"openai/gpt-4o\"\n prompt r#\"\n Return the given value:\n\n {{ input }}\n\n {{ ctx.output_format }}\n \"#\n}\n\ntype RecursiveListAlias = RecursiveListAlias[]\n\nfunction SimpleRecursiveListAlias(input: RecursiveListAlias) -> RecursiveListAlias {\n client \"openai/gpt-4o\"\n prompt r#\"\n Return the given JSON array:\n\n {{ input }}\n\n {{ ctx.output_format }}\n \"#\n}\n\ntype RecAliasOne = RecAliasTwo\ntype RecAliasTwo = RecAliasThree\ntype RecAliasThree = RecAliasOne[]\n\nfunction RecursiveAliasCycle(input: RecAliasOne) -> RecAliasOne {\n client \"openai/gpt-4o\"\n prompt r#\"\n Return the given JSON array:\n\n {{ input }}\n\n {{ ctx.output_format }}\n \"#\n}\n\ntype JsonValue = int | string | bool | float | JsonObject | JsonArray\ntype JsonObject = map\ntype JsonArray = JsonValue[]\n\nfunction JsonTypeAliasCycle(input: JsonValue) -> JsonValue {\n client \"openai/gpt-4o\"\n prompt r#\"\n Return the given input back:\n\n {{ input }}\n\n {{ ctx.output_format }}\n \"#\n}\n\nclass RecursiveAliasDependency {\n value JsonValue\n}\n\nfunction TakeRecAliasDep(input: RecursiveAliasDependency) -> RecursiveAliasDependency {\n client \"openai/gpt-4o\"\n prompt r#\"\n Return the given input back:\n\n {{ input }}\n\n {{ ctx.output_format }}\n \"#\n}\n", diff --git a/integ-tests/react/baml_client/partial_types.ts b/integ-tests/react/baml_client/partial_types.ts index 21d9597f3..6007f625f 100644 --- a/integ-tests/react/baml_client/partial_types.ts +++ b/integ-tests/react/baml_client/partial_types.ts @@ -17,7 +17,7 @@ $ pnpm add @boundaryml/baml // biome-ignore format: autogenerated code import type { Image, Audio } from "@boundaryml/baml" import type { Checked, Check } from "./types" -import type { AliasedEnum, AnotherObject, BigNumbers, BinaryNode, Blah, BlockConstraint, BlockConstraintForParam, BookOrder, Category, Category2, Category3, ClassForNullLiteral, ClassOptionalOutput, ClassOptionalOutput2, ClassToRecAlias, ClassWithBlockDone, ClassWithImage, ClassWithoutDone, Color, ComplexMemoryObject, CompoundBigNumbers, ContactInfo, CustomTaskResult, DataType, DummyOutput, DynEnumOne, DynEnumTwo, DynInputOutput, DynamicClassOne, DynamicClassTwo, DynamicOutput, Earthling, Education, Email, EmailAddress, EnumInClass, EnumOutput, Event, FakeImage, FlightConfirmation, FooAny, Forest, FormatterTest0, FormatterTest1, FormatterTest2, FormatterTest3, GroceryReceipt, Hobby, InnerClass, InnerClass2, InputClass, InputClassNested, JsonArray, JsonObject, JsonValue, LinkedList, LinkedListAliasNode, LiteralClassHello, LiteralClassOne, LiteralClassTwo, MalformedConstraints, MalformedConstraints2, MapKey, Martian, MemoryObject, MergeAttrs, NamedArgsSingleClass, NamedArgsSingleEnum, NamedArgsSingleEnumList, Nested, Nested2, NestedBlockConstraint, NestedBlockConstraintForParam, Node, NodeWithAliasIndirection, OptionalListAndMap, OptionalTest_CategoryType, OptionalTest_Prop1, OptionalTest_ReturnType, OrderInfo, OrderStatus, OriginalA, OriginalB, Person, PhoneNumber, Quantity, RaysData, RecAliasOne, RecAliasThree, RecAliasTwo, ReceiptInfo, ReceiptItem, Recipe, RecursiveAliasDependency, RecursiveListAlias, RecursiveMapAlias, Resume, Schema, SearchParams, SemanticContainer, SmallThing, SomeClassNestedDynamic, StringToClassEntry, Tag, TestClassAlias, TestClassNested, TestClassWithEnum, TestEnum, TestMemoryOutput, TestOutputClass, Tree, TwoStoriesOneTitle, UnionTest_ReturnType, UniverseQuestion, UniverseQuestionInput, WithReasoning } from "./types" +import type { AliasedEnum, AnotherObject, BigNumbers, BinaryNode, Blah, BlockConstraint, BlockConstraintForParam, BookOrder, Category, Category2, Category3, ClassForNullLiteral, ClassOptionalOutput, ClassOptionalOutput2, ClassToRecAlias, ClassWithBlockDone, ClassWithImage, ClassWithoutDone, Color, ComplexMemoryObject, CompoundBigNumbers, ContactInfo, CustomTaskResult, DataType, DummyOutput, DynEnumOne, DynEnumTwo, DynInputOutput, DynamicClassOne, DynamicClassTwo, DynamicOutput, Earthling, Education, Email, EmailAddress, EnumInClass, EnumOutput, Event, FakeImage, FlightConfirmation, FooAny, Forest, FormatterTest0, FormatterTest1, FormatterTest2, FormatterTest3, GroceryReceipt, Hobby, InnerClass, InnerClass2, InputClass, InputClassNested, JsonArray, JsonEntry, JsonObject, JsonTemplate, JsonValue, LinkedList, LinkedListAliasNode, LiteralClassHello, LiteralClassOne, LiteralClassTwo, MalformedConstraints, MalformedConstraints2, MapKey, Martian, MemoryObject, MergeAttrs, NamedArgsSingleClass, NamedArgsSingleEnum, NamedArgsSingleEnumList, Nested, Nested2, NestedBlockConstraint, NestedBlockConstraintForParam, Node, NodeWithAliasIndirection, OptionalListAndMap, OptionalTest_CategoryType, OptionalTest_Prop1, OptionalTest_ReturnType, OrderInfo, OrderStatus, OriginalA, OriginalB, Person, PhoneNumber, Quantity, RaysData, RecAliasOne, RecAliasThree, RecAliasTwo, ReceiptInfo, ReceiptItem, Recipe, RecursiveAliasDependency, RecursiveListAlias, RecursiveMapAlias, Resume, Schema, SearchParams, SemanticContainer, SimpleTag, SmallThing, SomeClassNestedDynamic, StringToClassEntry, Tag, TestClassAlias, TestClassNested, TestClassWithEnum, TestEnum, TestMemoryOutput, TestOutputClass, Tree, TwoStoriesOneTitle, UnionTest_ReturnType, UniverseQuestion, UniverseQuestionInput, WithReasoning } from "./types" import type * as types from "./types" /****************************************************************************** @@ -455,6 +455,10 @@ export namespace partial_types { final_string?: (string | null) } + export interface SimpleTag { + field?: (string | null) + } + export interface SmallThing { i_16_digits: number i_8_digits?: (number | null) diff --git a/integ-tests/react/baml_client/react/client.tsx b/integ-tests/react/baml_client/react/client.tsx index 66dda8848..d57a6b8cf 100644 --- a/integ-tests/react/baml_client/react/client.tsx +++ b/integ-tests/react/baml_client/react/client.tsx @@ -5025,6 +5025,60 @@ export function useReturnFailingAssert( return useBamlAction(Actions.ReturnFailingAssert, props); } +/** + * A specialized hook for the ReturnJsonEntry BAML function that supports both streaming and non‑streaming responses. + * + * **Input Types:** + * + * - s: string + * + * + * **Return Type:** + * - **Non‑streaming:** JsonTemplate + * - **Streaming Partial:** JsonTemplate + * - **Streaming Final:** JsonTemplate + * + * **Usage Patterns:** + * 1. **Non‑streaming (Default)** + * - Best for quick responses and simple UI updates. + * 2. **Streaming** + * - Ideal for long‑running operations or real‑time feedback. + * + * **Edge Cases:** + * - Ensure robust error handling via `onError`. + * - Handle cases where partial data may be incomplete or missing. + * + * @example + * ```tsx + * // Basic non‑streaming usage: + * const { data, error, isPending, mutate } = useReturnJsonEntry(); + * + * // Streaming usage: + * const { data, partialData, isPending, error, mutate } = useReturnJsonEntry({ + * stream: true, + * onPartial: (partial) => console.log('Partial update:', partial), + * onFinal: (final) => console.log('Final result:', final), + * onError: (err) => console.error('Error:', err), + * }); + * ``` + */ +export function useReturnJsonEntry( + props: StreamingProps<'ReturnJsonEntry'> +): StreamingHookResult<'ReturnJsonEntry'>; + +export function useReturnJsonEntry( + props?: NonStreamingProps<'ReturnJsonEntry'> +): NonStreamingHookResult<'ReturnJsonEntry'>; + +export function useReturnJsonEntry( + props: HookProps<'ReturnJsonEntry'> = {} +): StreamingHookResult<'ReturnJsonEntry'> | NonStreamingHookResult<'ReturnJsonEntry'> { + if (props.stream) { + return useBamlAction(StreamingActions.ReturnJsonEntry, props); + } + + return useBamlAction(Actions.ReturnJsonEntry, props); +} /** * A specialized hook for the ReturnMalformedConstraints BAML function that supports both streaming and non‑streaming responses. * diff --git a/integ-tests/react/baml_client/react/server.ts b/integ-tests/react/baml_client/react/server.ts index 299d105da..499287432 100644 --- a/integ-tests/react/baml_client/react/server.ts +++ b/integ-tests/react/baml_client/react/server.ts @@ -21,7 +21,7 @@ import { b } from '../index'; import type { Check, Checked } from "../types"; import type { Image, Audio } from "@boundaryml/baml"; -import type { AliasedEnum, AnotherObject, BigNumbers, BinaryNode, Blah, BlockConstraint, BlockConstraintForParam, BookOrder, Category, Category2, Category3, ClassForNullLiteral, ClassOptionalOutput, ClassOptionalOutput2, ClassToRecAlias, ClassWithBlockDone, ClassWithImage, ClassWithoutDone, Color, ComplexMemoryObject, CompoundBigNumbers, ContactInfo, CustomTaskResult, DataType, DummyOutput, DynEnumOne, DynEnumTwo, DynInputOutput, DynamicClassOne, DynamicClassTwo, DynamicOutput, Earthling, Education, Email, EmailAddress, EnumInClass, EnumOutput, Event, FakeImage, FlightConfirmation, FooAny, Forest, FormatterTest0, FormatterTest1, FormatterTest2, FormatterTest3, GroceryReceipt, Hobby, InnerClass, InnerClass2, InputClass, InputClassNested, JsonArray, JsonObject, JsonValue, LinkedList, LinkedListAliasNode, LiteralClassHello, LiteralClassOne, LiteralClassTwo, MalformedConstraints, MalformedConstraints2, MapKey, Martian, MemoryObject, MergeAttrs, NamedArgsSingleClass, NamedArgsSingleEnum, NamedArgsSingleEnumList, Nested, Nested2, NestedBlockConstraint, NestedBlockConstraintForParam, Node, NodeWithAliasIndirection, OptionalListAndMap, OptionalTest_CategoryType, OptionalTest_Prop1, OptionalTest_ReturnType, OrderInfo, OrderStatus, OriginalA, OriginalB, Person, PhoneNumber, Quantity, RaysData, RecAliasOne, RecAliasThree, RecAliasTwo, ReceiptInfo, ReceiptItem, Recipe, RecursiveAliasDependency, RecursiveListAlias, RecursiveMapAlias, Resume, Schema, SearchParams, SemanticContainer, SmallThing, SomeClassNestedDynamic, StringToClassEntry, Tag, TestClassAlias, TestClassNested, TestClassWithEnum, TestEnum, TestMemoryOutput, TestOutputClass, Tree, TwoStoriesOneTitle, UnionTest_ReturnType, UniverseQuestion, UniverseQuestionInput, WithReasoning } from "../types" +import type { AliasedEnum, AnotherObject, BigNumbers, BinaryNode, Blah, BlockConstraint, BlockConstraintForParam, BookOrder, Category, Category2, Category3, ClassForNullLiteral, ClassOptionalOutput, ClassOptionalOutput2, ClassToRecAlias, ClassWithBlockDone, ClassWithImage, ClassWithoutDone, Color, ComplexMemoryObject, CompoundBigNumbers, ContactInfo, CustomTaskResult, DataType, DummyOutput, DynEnumOne, DynEnumTwo, DynInputOutput, DynamicClassOne, DynamicClassTwo, DynamicOutput, Earthling, Education, Email, EmailAddress, EnumInClass, EnumOutput, Event, FakeImage, FlightConfirmation, FooAny, Forest, FormatterTest0, FormatterTest1, FormatterTest2, FormatterTest3, GroceryReceipt, Hobby, InnerClass, InnerClass2, InputClass, InputClassNested, JsonArray, JsonEntry, JsonObject, JsonTemplate, JsonValue, LinkedList, LinkedListAliasNode, LiteralClassHello, LiteralClassOne, LiteralClassTwo, MalformedConstraints, MalformedConstraints2, MapKey, Martian, MemoryObject, MergeAttrs, NamedArgsSingleClass, NamedArgsSingleEnum, NamedArgsSingleEnumList, Nested, Nested2, NestedBlockConstraint, NestedBlockConstraintForParam, Node, NodeWithAliasIndirection, OptionalListAndMap, OptionalTest_CategoryType, OptionalTest_Prop1, OptionalTest_ReturnType, OrderInfo, OrderStatus, OriginalA, OriginalB, Person, PhoneNumber, Quantity, RaysData, RecAliasOne, RecAliasThree, RecAliasTwo, ReceiptInfo, ReceiptItem, Recipe, RecursiveAliasDependency, RecursiveListAlias, RecursiveMapAlias, Resume, Schema, SearchParams, SemanticContainer, SimpleTag, SmallThing, SomeClassNestedDynamic, StringToClassEntry, Tag, TestClassAlias, TestClassNested, TestClassWithEnum, TestEnum, TestMemoryOutput, TestOutputClass, Tree, TwoStoriesOneTitle, UnionTest_ReturnType, UniverseQuestion, UniverseQuestionInput, WithReasoning } from "../types" import type * as types from "../types" @@ -1625,6 +1625,24 @@ export const ReturnFailingAssert = async ( ); }; +/** + * Executes the "ReturnJsonEntry" BAML action. + * + * This server action calls the underlying BAML function "ReturnJsonEntry" + * with the specified parameters. + * + * @param { string } s - Input parameter. + * + * @returns {Promise} A promise that resolves with the result of the action. + */ +export const ReturnJsonEntry = async ( + s: string, +): Promise => { + return b.ReturnJsonEntry( + s, + ); +}; + /** * Executes the "ReturnMalformedConstraints" BAML action. * diff --git a/integ-tests/react/baml_client/react/server_streaming.ts b/integ-tests/react/baml_client/react/server_streaming.ts index c84ea3d06..d36f83c2d 100644 --- a/integ-tests/react/baml_client/react/server_streaming.ts +++ b/integ-tests/react/baml_client/react/server_streaming.ts @@ -21,7 +21,7 @@ import { b } from '../index'; import type { Check, Checked } from "../types"; import type { Image, Audio } from "@boundaryml/baml"; -import type { AliasedEnum, AnotherObject, BigNumbers, BinaryNode, Blah, BlockConstraint, BlockConstraintForParam, BookOrder, Category, Category2, Category3, ClassForNullLiteral, ClassOptionalOutput, ClassOptionalOutput2, ClassToRecAlias, ClassWithBlockDone, ClassWithImage, ClassWithoutDone, Color, ComplexMemoryObject, CompoundBigNumbers, ContactInfo, CustomTaskResult, DataType, DummyOutput, DynEnumOne, DynEnumTwo, DynInputOutput, DynamicClassOne, DynamicClassTwo, DynamicOutput, Earthling, Education, Email, EmailAddress, EnumInClass, EnumOutput, Event, FakeImage, FlightConfirmation, FooAny, Forest, FormatterTest0, FormatterTest1, FormatterTest2, FormatterTest3, GroceryReceipt, Hobby, InnerClass, InnerClass2, InputClass, InputClassNested, JsonArray, JsonObject, JsonValue, LinkedList, LinkedListAliasNode, LiteralClassHello, LiteralClassOne, LiteralClassTwo, MalformedConstraints, MalformedConstraints2, MapKey, Martian, MemoryObject, MergeAttrs, NamedArgsSingleClass, NamedArgsSingleEnum, NamedArgsSingleEnumList, Nested, Nested2, NestedBlockConstraint, NestedBlockConstraintForParam, Node, NodeWithAliasIndirection, OptionalListAndMap, OptionalTest_CategoryType, OptionalTest_Prop1, OptionalTest_ReturnType, OrderInfo, OrderStatus, OriginalA, OriginalB, Person, PhoneNumber, Quantity, RaysData, RecAliasOne, RecAliasThree, RecAliasTwo, ReceiptInfo, ReceiptItem, Recipe, RecursiveAliasDependency, RecursiveListAlias, RecursiveMapAlias, Resume, Schema, SearchParams, SemanticContainer, SmallThing, SomeClassNestedDynamic, StringToClassEntry, Tag, TestClassAlias, TestClassNested, TestClassWithEnum, TestEnum, TestMemoryOutput, TestOutputClass, Tree, TwoStoriesOneTitle, UnionTest_ReturnType, UniverseQuestion, UniverseQuestionInput, WithReasoning } from "../types" +import type { AliasedEnum, AnotherObject, BigNumbers, BinaryNode, Blah, BlockConstraint, BlockConstraintForParam, BookOrder, Category, Category2, Category3, ClassForNullLiteral, ClassOptionalOutput, ClassOptionalOutput2, ClassToRecAlias, ClassWithBlockDone, ClassWithImage, ClassWithoutDone, Color, ComplexMemoryObject, CompoundBigNumbers, ContactInfo, CustomTaskResult, DataType, DummyOutput, DynEnumOne, DynEnumTwo, DynInputOutput, DynamicClassOne, DynamicClassTwo, DynamicOutput, Earthling, Education, Email, EmailAddress, EnumInClass, EnumOutput, Event, FakeImage, FlightConfirmation, FooAny, Forest, FormatterTest0, FormatterTest1, FormatterTest2, FormatterTest3, GroceryReceipt, Hobby, InnerClass, InnerClass2, InputClass, InputClassNested, JsonArray, JsonEntry, JsonObject, JsonTemplate, JsonValue, LinkedList, LinkedListAliasNode, LiteralClassHello, LiteralClassOne, LiteralClassTwo, MalformedConstraints, MalformedConstraints2, MapKey, Martian, MemoryObject, MergeAttrs, NamedArgsSingleClass, NamedArgsSingleEnum, NamedArgsSingleEnumList, Nested, Nested2, NestedBlockConstraint, NestedBlockConstraintForParam, Node, NodeWithAliasIndirection, OptionalListAndMap, OptionalTest_CategoryType, OptionalTest_Prop1, OptionalTest_ReturnType, OrderInfo, OrderStatus, OriginalA, OriginalB, Person, PhoneNumber, Quantity, RaysData, RecAliasOne, RecAliasThree, RecAliasTwo, ReceiptInfo, ReceiptItem, Recipe, RecursiveAliasDependency, RecursiveListAlias, RecursiveMapAlias, Resume, Schema, SearchParams, SemanticContainer, SimpleTag, SmallThing, SomeClassNestedDynamic, StringToClassEntry, Tag, TestClassAlias, TestClassNested, TestClassWithEnum, TestEnum, TestMemoryOutput, TestOutputClass, Tree, TwoStoriesOneTitle, UnionTest_ReturnType, UniverseQuestion, UniverseQuestionInput, WithReasoning } from "../types" import type * as types from "../types" @@ -1713,6 +1713,25 @@ export const ReturnFailingAssert = async ( return Promise.resolve(stream.toStreamable()); }; +/** + * Executes the streaming variant of the "ReturnJsonEntry" BAML action. + * + * This action initiates a streaming response by calling the corresponding + * BAML stream function. The returned stream yields incremental updates. + * + * @param { string } s - Input parameter. + * + * @returns {ReadableStream} A stream that yields incremental updates from the action. + */ +export const ReturnJsonEntry = async ( + s: string, +): Promise> => { + const stream = b.stream.ReturnJsonEntry( + s, + ); + return Promise.resolve(stream.toStreamable()); +}; + /** * Executes the streaming variant of the "ReturnMalformedConstraints" BAML action. * diff --git a/integ-tests/react/baml_client/react/server_streaming_types.ts b/integ-tests/react/baml_client/react/server_streaming_types.ts index 32b58cfc1..38816fdba 100644 --- a/integ-tests/react/baml_client/react/server_streaming_types.ts +++ b/integ-tests/react/baml_client/react/server_streaming_types.ts @@ -18,7 +18,7 @@ $ pnpm add @boundaryml/baml import type { Check, Checked } from "../types"; import type { Image, Audio } from "@boundaryml/baml"; -import type { AliasedEnum, AnotherObject, BigNumbers, BinaryNode, Blah, BlockConstraint, BlockConstraintForParam, BookOrder, Category, Category2, Category3, ClassForNullLiteral, ClassOptionalOutput, ClassOptionalOutput2, ClassToRecAlias, ClassWithBlockDone, ClassWithImage, ClassWithoutDone, Color, ComplexMemoryObject, CompoundBigNumbers, ContactInfo, CustomTaskResult, DataType, DummyOutput, DynEnumOne, DynEnumTwo, DynInputOutput, DynamicClassOne, DynamicClassTwo, DynamicOutput, Earthling, Education, Email, EmailAddress, EnumInClass, EnumOutput, Event, FakeImage, FlightConfirmation, FooAny, Forest, FormatterTest0, FormatterTest1, FormatterTest2, FormatterTest3, GroceryReceipt, Hobby, InnerClass, InnerClass2, InputClass, InputClassNested, JsonArray, JsonObject, JsonValue, LinkedList, LinkedListAliasNode, LiteralClassHello, LiteralClassOne, LiteralClassTwo, MalformedConstraints, MalformedConstraints2, MapKey, Martian, MemoryObject, MergeAttrs, NamedArgsSingleClass, NamedArgsSingleEnum, NamedArgsSingleEnumList, Nested, Nested2, NestedBlockConstraint, NestedBlockConstraintForParam, Node, NodeWithAliasIndirection, OptionalListAndMap, OptionalTest_CategoryType, OptionalTest_Prop1, OptionalTest_ReturnType, OrderInfo, OrderStatus, OriginalA, OriginalB, Person, PhoneNumber, Quantity, RaysData, RecAliasOne, RecAliasThree, RecAliasTwo, ReceiptInfo, ReceiptItem, Recipe, RecursiveAliasDependency, RecursiveListAlias, RecursiveMapAlias, Resume, Schema, SearchParams, SemanticContainer, SmallThing, SomeClassNestedDynamic, StringToClassEntry, Tag, TestClassAlias, TestClassNested, TestClassWithEnum, TestEnum, TestMemoryOutput, TestOutputClass, Tree, TwoStoriesOneTitle, UnionTest_ReturnType, UniverseQuestion, UniverseQuestionInput, WithReasoning } from "../types" +import type { AliasedEnum, AnotherObject, BigNumbers, BinaryNode, Blah, BlockConstraint, BlockConstraintForParam, BookOrder, Category, Category2, Category3, ClassForNullLiteral, ClassOptionalOutput, ClassOptionalOutput2, ClassToRecAlias, ClassWithBlockDone, ClassWithImage, ClassWithoutDone, Color, ComplexMemoryObject, CompoundBigNumbers, ContactInfo, CustomTaskResult, DataType, DummyOutput, DynEnumOne, DynEnumTwo, DynInputOutput, DynamicClassOne, DynamicClassTwo, DynamicOutput, Earthling, Education, Email, EmailAddress, EnumInClass, EnumOutput, Event, FakeImage, FlightConfirmation, FooAny, Forest, FormatterTest0, FormatterTest1, FormatterTest2, FormatterTest3, GroceryReceipt, Hobby, InnerClass, InnerClass2, InputClass, InputClassNested, JsonArray, JsonEntry, JsonObject, JsonTemplate, JsonValue, LinkedList, LinkedListAliasNode, LiteralClassHello, LiteralClassOne, LiteralClassTwo, MalformedConstraints, MalformedConstraints2, MapKey, Martian, MemoryObject, MergeAttrs, NamedArgsSingleClass, NamedArgsSingleEnum, NamedArgsSingleEnumList, Nested, Nested2, NestedBlockConstraint, NestedBlockConstraintForParam, Node, NodeWithAliasIndirection, OptionalListAndMap, OptionalTest_CategoryType, OptionalTest_Prop1, OptionalTest_ReturnType, OrderInfo, OrderStatus, OriginalA, OriginalB, Person, PhoneNumber, Quantity, RaysData, RecAliasOne, RecAliasThree, RecAliasTwo, ReceiptInfo, ReceiptItem, Recipe, RecursiveAliasDependency, RecursiveListAlias, RecursiveMapAlias, Resume, Schema, SearchParams, SemanticContainer, SimpleTag, SmallThing, SomeClassNestedDynamic, StringToClassEntry, Tag, TestClassAlias, TestClassNested, TestClassWithEnum, TestEnum, TestMemoryOutput, TestOutputClass, Tree, TwoStoriesOneTitle, UnionTest_ReturnType, UniverseQuestion, UniverseQuestionInput, WithReasoning } from "../types" import type * as types from "../types" import type { partial_types }from "../partial_types"; @@ -112,6 +112,7 @@ export type StreamingServerTypes = { RecursiveClassWithAliasIndirection: partial_types.NodeWithAliasIndirection, ReturnAliasWithMergedAttributes: Checked, ReturnFailingAssert: number, + ReturnJsonEntry: JsonTemplate, ReturnMalformedConstraints: partial_types.MalformedConstraints, SchemaDescriptions: partial_types.Schema, SimpleRecursiveListAlias: RecursiveListAlias, diff --git a/integ-tests/react/baml_client/sync_client.ts b/integ-tests/react/baml_client/sync_client.ts index 40e2c8ec4..5c6e070ac 100644 --- a/integ-tests/react/baml_client/sync_client.ts +++ b/integ-tests/react/baml_client/sync_client.ts @@ -17,7 +17,7 @@ $ pnpm add @boundaryml/baml // biome-ignore format: autogenerated code import { type BamlCtxManager, type BamlRuntime, BamlValidationError, type ClientRegistry, FunctionResult, type Image, createBamlValidationError } from "@boundaryml/baml" import type { Checked, Check, RecursivePartialNull as MovedRecursivePartialNull } from "./types" -import type {AliasedEnum, AnotherObject, BigNumbers, BinaryNode, Blah, BlockConstraint, BlockConstraintForParam, BookOrder, Category, Category2, Category3, ClassForNullLiteral, ClassOptionalOutput, ClassOptionalOutput2, ClassToRecAlias, ClassWithBlockDone, ClassWithImage, ClassWithoutDone, Color, ComplexMemoryObject, CompoundBigNumbers, ContactInfo, CustomTaskResult, DataType, DummyOutput, DynEnumOne, DynEnumTwo, DynInputOutput, DynamicClassOne, DynamicClassTwo, DynamicOutput, Earthling, Education, Email, EmailAddress, EnumInClass, EnumOutput, Event, FakeImage, FlightConfirmation, FooAny, Forest, FormatterTest0, FormatterTest1, FormatterTest2, FormatterTest3, GroceryReceipt, Hobby, InnerClass, InnerClass2, InputClass, InputClassNested, JsonArray, JsonObject, JsonValue, LinkedList, LinkedListAliasNode, LiteralClassHello, LiteralClassOne, LiteralClassTwo, MalformedConstraints, MalformedConstraints2, MapKey, Martian, MemoryObject, MergeAttrs, NamedArgsSingleClass, NamedArgsSingleEnum, NamedArgsSingleEnumList, Nested, Nested2, NestedBlockConstraint, NestedBlockConstraintForParam, Node, NodeWithAliasIndirection, OptionalListAndMap, OptionalTest_CategoryType, OptionalTest_Prop1, OptionalTest_ReturnType, OrderInfo, OrderStatus, OriginalA, OriginalB, Person, PhoneNumber, Quantity, RaysData, RecAliasOne, RecAliasThree, RecAliasTwo, ReceiptInfo, ReceiptItem, Recipe, RecursiveAliasDependency, RecursiveListAlias, RecursiveMapAlias, Resume, Schema, SearchParams, SemanticContainer, SmallThing, SomeClassNestedDynamic, StringToClassEntry, Tag, TestClassAlias, TestClassNested, TestClassWithEnum, TestEnum, TestMemoryOutput, TestOutputClass, Tree, TwoStoriesOneTitle, UnionTest_ReturnType, UniverseQuestion, UniverseQuestionInput, WithReasoning} from "./types" +import type {AliasedEnum, AnotherObject, BigNumbers, BinaryNode, Blah, BlockConstraint, BlockConstraintForParam, BookOrder, Category, Category2, Category3, ClassForNullLiteral, ClassOptionalOutput, ClassOptionalOutput2, ClassToRecAlias, ClassWithBlockDone, ClassWithImage, ClassWithoutDone, Color, ComplexMemoryObject, CompoundBigNumbers, ContactInfo, CustomTaskResult, DataType, DummyOutput, DynEnumOne, DynEnumTwo, DynInputOutput, DynamicClassOne, DynamicClassTwo, DynamicOutput, Earthling, Education, Email, EmailAddress, EnumInClass, EnumOutput, Event, FakeImage, FlightConfirmation, FooAny, Forest, FormatterTest0, FormatterTest1, FormatterTest2, FormatterTest3, GroceryReceipt, Hobby, InnerClass, InnerClass2, InputClass, InputClassNested, JsonArray, JsonEntry, JsonObject, JsonTemplate, JsonValue, LinkedList, LinkedListAliasNode, LiteralClassHello, LiteralClassOne, LiteralClassTwo, MalformedConstraints, MalformedConstraints2, MapKey, Martian, MemoryObject, MergeAttrs, NamedArgsSingleClass, NamedArgsSingleEnum, NamedArgsSingleEnumList, Nested, Nested2, NestedBlockConstraint, NestedBlockConstraintForParam, Node, NodeWithAliasIndirection, OptionalListAndMap, OptionalTest_CategoryType, OptionalTest_Prop1, OptionalTest_ReturnType, OrderInfo, OrderStatus, OriginalA, OriginalB, Person, PhoneNumber, Quantity, RaysData, RecAliasOne, RecAliasThree, RecAliasTwo, ReceiptInfo, ReceiptItem, Recipe, RecursiveAliasDependency, RecursiveListAlias, RecursiveMapAlias, Resume, Schema, SearchParams, SemanticContainer, SimpleTag, SmallThing, SomeClassNestedDynamic, StringToClassEntry, Tag, TestClassAlias, TestClassNested, TestClassWithEnum, TestEnum, TestMemoryOutput, TestOutputClass, Tree, TwoStoriesOneTitle, UnionTest_ReturnType, UniverseQuestion, UniverseQuestionInput, WithReasoning} from "./types" import type 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" @@ -2244,6 +2244,31 @@ export class BamlSyncClient { } } + ReturnJsonEntry( + s: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): JsonTemplate { + try { + const raw = this.runtime.callFunctionSync( + "ReturnJsonEntry", + { + "s": s + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as JsonTemplate + } catch (error: any) { + const bamlError = createBamlValidationError(error); + if (bamlError instanceof BamlValidationError) { + throw bamlError; + } + + throw error; + } + } + ReturnMalformedConstraints( a: number, __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } diff --git a/integ-tests/react/baml_client/type_builder.ts b/integ-tests/react/baml_client/type_builder.ts index 5a62db7b4..7f114f972 100644 --- a/integ-tests/react/baml_client/type_builder.ts +++ b/integ-tests/react/baml_client/type_builder.ts @@ -51,7 +51,7 @@ export default class TypeBuilder { constructor() { this.tb = new _TypeBuilder({ classes: new Set([ - "AnotherObject","BigNumbers","BinaryNode","Blah","BlockConstraint","BlockConstraintForParam","BookOrder","ClassForNullLiteral","ClassOptionalOutput","ClassOptionalOutput2","ClassToRecAlias","ClassWithBlockDone","ClassWithImage","ClassWithoutDone","ComplexMemoryObject","CompoundBigNumbers","ContactInfo","CustomTaskResult","DummyOutput","DynInputOutput","DynamicClassOne","DynamicClassTwo","DynamicOutput","Earthling","Education","Email","EmailAddress","Event","FakeImage","FlightConfirmation","FooAny","Forest","FormatterTest0","FormatterTest1","FormatterTest2","FormatterTest3","GroceryReceipt","InnerClass","InnerClass2","InputClass","InputClassNested","LinkedList","LinkedListAliasNode","LiteralClassHello","LiteralClassOne","LiteralClassTwo","MalformedConstraints","MalformedConstraints2","Martian","MemoryObject","MergeAttrs","NamedArgsSingleClass","Nested","Nested2","NestedBlockConstraint","NestedBlockConstraintForParam","Node","NodeWithAliasIndirection","OptionalListAndMap","OptionalTest_Prop1","OptionalTest_ReturnType","OrderInfo","OriginalA","OriginalB","Person","PhoneNumber","Quantity","RaysData","ReceiptInfo","ReceiptItem","Recipe","RecursiveAliasDependency","Resume","Schema","SearchParams","SemanticContainer","SmallThing","SomeClassNestedDynamic","StringToClassEntry","TestClassAlias","TestClassNested","TestClassWithEnum","TestMemoryOutput","TestOutputClass","Tree","TwoStoriesOneTitle","UnionTest_ReturnType","UniverseQuestion","UniverseQuestionInput","WithReasoning", + "AnotherObject","BigNumbers","BinaryNode","Blah","BlockConstraint","BlockConstraintForParam","BookOrder","ClassForNullLiteral","ClassOptionalOutput","ClassOptionalOutput2","ClassToRecAlias","ClassWithBlockDone","ClassWithImage","ClassWithoutDone","ComplexMemoryObject","CompoundBigNumbers","ContactInfo","CustomTaskResult","DummyOutput","DynInputOutput","DynamicClassOne","DynamicClassTwo","DynamicOutput","Earthling","Education","Email","EmailAddress","Event","FakeImage","FlightConfirmation","FooAny","Forest","FormatterTest0","FormatterTest1","FormatterTest2","FormatterTest3","GroceryReceipt","InnerClass","InnerClass2","InputClass","InputClassNested","LinkedList","LinkedListAliasNode","LiteralClassHello","LiteralClassOne","LiteralClassTwo","MalformedConstraints","MalformedConstraints2","Martian","MemoryObject","MergeAttrs","NamedArgsSingleClass","Nested","Nested2","NestedBlockConstraint","NestedBlockConstraintForParam","Node","NodeWithAliasIndirection","OptionalListAndMap","OptionalTest_Prop1","OptionalTest_ReturnType","OrderInfo","OriginalA","OriginalB","Person","PhoneNumber","Quantity","RaysData","ReceiptInfo","ReceiptItem","Recipe","RecursiveAliasDependency","Resume","Schema","SearchParams","SemanticContainer","SimpleTag","SmallThing","SomeClassNestedDynamic","StringToClassEntry","TestClassAlias","TestClassNested","TestClassWithEnum","TestMemoryOutput","TestOutputClass","Tree","TwoStoriesOneTitle","UnionTest_ReturnType","UniverseQuestion","UniverseQuestionInput","WithReasoning", ]), enums: new Set([ "AliasedEnum","Category","Category2","Category3","Color","DataType","DynEnumOne","DynEnumTwo","EnumInClass","EnumOutput","Hobby","MapKey","NamedArgsSingleEnum","NamedArgsSingleEnumList","OptionalTest_CategoryType","OrderStatus","Tag","TestEnum", diff --git a/integ-tests/react/baml_client/types.ts b/integ-tests/react/baml_client/types.ts index e55f637c5..2c1841635 100644 --- a/integ-tests/react/baml_client/types.ts +++ b/integ-tests/react/baml_client/types.ts @@ -657,6 +657,11 @@ export interface SemanticContainer { } +export interface SimpleTag { + field: string + +} + export interface SmallThing { i_16_digits: number i_8_digits: number @@ -749,8 +754,12 @@ export interface WithReasoning { export type JsonArray = JsonValue[] +export type JsonEntry = SimpleTag | JsonTemplate + export type JsonObject = Record +export type JsonTemplate = Record + export type JsonValue = number | string | boolean | number | JsonObject | JsonArray export type RecAliasOne = RecAliasTwo diff --git a/integ-tests/ruby/baml_client/inlined.rb b/integ-tests/ruby/baml_client/inlined.rb index d41a7177e..046b271ae 100644 --- a/integ-tests/ruby/baml_client/inlined.rb +++ b/integ-tests/ruby/baml_client/inlined.rb @@ -15,7 +15,7 @@ module Baml module Inlined FILE_MAP = { - + "clients.baml" => "retry_policy Bar {\n max_retries 3\n strategy {\n type exponential_backoff\n }\n}\n\nretry_policy Foo {\n max_retries 3\n strategy {\n type constant_delay\n delay_ms 100\n }\n}\n\nclient GPT4 {\n provider openai\n options {\n model gpt-4o\n api_key env.OPENAI_API_KEY\n }\n}\n\n\nclient GPT4o {\n provider openai\n options {\n model gpt-4o\n api_key env.OPENAI_API_KEY\n }\n}\n\n\nclient GPT4Turbo {\n retry_policy Bar\n provider openai\n options {\n model gpt-4-turbo\n api_key env.OPENAI_API_KEY\n }\n}\n\nretry_policy GPT4oRetry {\n max_retries 2\n strategy {\n type exponential_backoff\n }\n}\n\nclient GPT35 {\n provider openai\n retry_policy GPT4oRetry\n options {\n model \"gpt-4o-mini\"\n api_key env.OPENAI_API_KEY\n }\n}\n\nclient GPT35LegacyProvider {\n provider openai\n options {\n model \"gpt-3.5-turbo\"\n api_key env.OPENAI_API_KEY\n }\n}\n\n\nclient Ollama {\n provider ollama\n options {\n model llama2\n }\n}\n\nclient GPT35Azure {\n provider azure-openai\n options {\n resource_name \"west-us-azure-baml\"\n deployment_id \"gpt-35-turbo-default\"\n // base_url \"https://west-us-azure-baml.openai.azure.com/openai/deployments/gpt-35-turbo-default\"\n api_version \"2024-02-01\"\n api_key env.AZURE_OPENAI_API_KEY\n }\n}\n\n// Azure O1 client without max_tokens (should not add default)\nclient AzureO1 {\n provider azure-openai\n options {\n resource_name \"west-us-azure-baml\"\n deployment_id \"o1-mini\"\n api_version \"2024-08-01-preview\"\n api_key env.AZURE_OPENAI_API_KEY\n max_tokens null\n }\n}\n\n// Azure O1 client with explicit max_tokens (should keep user value)\nclient AzureO1WithMaxTokens {\n provider azure-openai\n options {\n resource_name \"west-us-azure-baml\"\n deployment_id \"o1-mini\"\n api_version \"2024-08-01-preview\"\n api_key env.AZURE_OPENAI_API_KEY\n max_tokens 1000\n }\n}\n\nclient AzureO1WithMaxCompletionTokens {\n provider azure-openai\n options {\n resource_name \"west-us-azure-baml\"\n deployment_id \"o1-mini\"\n api_version \"2024-08-01-preview\"\n api_key env.AZURE_OPENAI_API_KEY\n max_completion_tokens 1000\n }\n}\n\n// Azure GPT-35 client with explicit max_tokens (should keep user value)\nclient GPT35AzureWithMaxTokens {\n provider azure-openai\n options {\n resource_name \"west-us-azure-baml\"\n deployment_id \"gpt-35-turbo-default\"\n api_version \"2024-02-01\"\n api_key env.AZURE_OPENAI_API_KEY\n max_tokens 1000\n }\n}\n\n// Azure client with invalid resource name (for testing failures)\nclient GPT35AzureFailed {\n provider azure-openai\n options {\n resource_name \"west-us-azure-baml-incorrect-suffix\"\n deployment_id \"gpt-35-turbo-default\"\n api_key env.AZURE_OPENAI_API_KEY\n }\n}\n\nclient Gemini {\n provider google-ai\n options {\n model gemini-1.5-pro-001\n api_key env.GOOGLE_API_KEY\n safetySettings {\n category HARM_CATEGORY_HATE_SPEECH\n threshold BLOCK_LOW_AND_ABOVE\n }\n }\n}\n\nclient GeminiOpenAiGeneric {\n provider \"openai-generic\"\n options {\n base_url \"https://generativelanguage.googleapis.com/v1beta/\"\n model \"gemini-1.5-flash\"\n api_key env.GOOGLE_API_KEY\n }\n}\n\nclient Vertex {\n provider vertex-ai\n options {\n model gemini-1.5-pro\n location us-central1\n credentials env.INTEG_TESTS_GOOGLE_APPLICATION_CREDENTIALS_CONTENT\n }\n}\n\n\nclient AwsBedrock {\n provider aws-bedrock\n options {\n inference_configuration {\n max_tokens 100\n }\n // model \"anthropic.claude-3-5-sonnet-20240620-v1:0\"\n // model_id \"anthropic.claude-3-haiku-20240307-v1:0\"\n model \"meta.llama3-8b-instruct-v1:0\"\n // region \"us-east-1\"\n // access_key_id env.AWS_ACCESS_KEY_ID\n // secret_access_key env.AWS_SECRET_ACCESS_KEY\n // session_token env.AWS_SESSION_TOKEN\n // session_token null\n // model_id \"mistral.mistral-7b-instruct-v0:2\"\n }\n}\n\nclient AwsBedrockInvalidRegion {\n provider aws-bedrock\n options {\n region \"us-invalid-7\"\n inference_configuration {\n max_tokens 100\n }\n // model \"anthropic.claude-3-5-sonnet-20240620-v1:0\"\n // model_id \"anthropic.claude-3-haiku-20240307-v1:0\"\n model_id \"meta.llama3-8b-instruct-v1:0\"\n // model_id \"mistral.mistral-7b-instruct-v0:2\"\n }\n}\n\nclient AwsBedrockInvalidAccessKey {\n provider aws-bedrock\n options {\n model_id \"meta.llama3-8b-instruct-v1:0\"\n access_key_id \"AKIAINVALID12345678\"\n secret_access_key \"abcdef1234567890abcdef1234567890abcdef12\"\n inference_configuration {\n max_tokens 100\n }\n }\n}\n\nclient AwsBedrockInvalidProfile {\n provider aws-bedrock\n options {\n model_id \"meta.llama3-8b-instruct-v1:0\"\n profile \"invalid-profile\"\n inference_configuration {\n max_tokens 100\n }\n }\n}\n\nclient AwsBedrockInvalidSessionToken {\n provider aws-bedrock\n options {\n model_id \"meta.llama3-8b-instruct-v1:0\"\n region \"us-east-1\"\n access_key_id \"AKIAINVALID12345678\"\n secret_access_key \"abcdef1234567890abcdef1234567890abcdef12\"\n session_token \"invalid-session-token\"\n inference_configuration {\n max_tokens 100\n }\n }\n}\n\n\nclient Invalid{\n provider aws-bedrock\n options {\n model_id \"meta.llama3-8b-instruct-v1:0\"\n region \"us-east-1\"\n access_key_id \"AKIAINVALID12345678\"\n secret_access_key \"abcdef1234567890abcdef1234567890abcdef12\"\n session_token \"invalid-session-token\"\n inference_configuration {\n max_tokens 100\n }\n }\n}\n\nclient Sonnet {\n provider anthropic\n options {\n model claude-3-5-sonnet-20241022\n api_key env.ANTHROPIC_API_KEY\n }\n}\n\nclient Claude {\n provider anthropic\n options {\n model claude-3-haiku-20240307\n api_key env.ANTHROPIC_API_KEY\n max_tokens 1000\n }\n}\n\nclient ClaudeWithCaching {\n provider anthropic\n options {\n model claude-3-haiku-20240307\n api_key env.ANTHROPIC_API_KEY\n max_tokens 500\n allowed_role_metadata [\"cache_control\"]\n headers {\n \"anthropic-beta\" \"prompt-caching-2024-07-31\"\n }\n }\n}\n\nclient Resilient_SimpleSyntax {\n retry_policy Foo\n provider baml-fallback\n options {\n strategy [\n GPT4Turbo\n GPT35\n Lottery_SimpleSyntax\n ]\n }\n}\n\nclient Lottery_SimpleSyntax {\n provider baml-round-robin\n options {\n start 0\n strategy [\n GPT35\n Claude\n ]\n }\n}\n\nclient TogetherAi {\n provider \"openai-generic\"\n options {\n base_url \"https://api.together.ai/v1\"\n api_key env.TOGETHER_API_KEY\n model \"meta-llama/Llama-3-70b-chat-hf\"\n }\n}\n\n// OpenAI O1 client without max_tokens (should not add default)\nclient OpenAIO1 {\n provider openai\n options {\n model \"o1-mini\"\n api_key env.OPENAI_API_KEY\n }\n}\n\n// OpenAI O1 client with explicit max_tokens (should fail)\nclient OpenAIO1WithMaxTokens {\n provider openai\n options {\n model \"o1-mini\"\n api_key env.OPENAI_API_KEY\n max_tokens 1000\n }\n}\n\n// OpenAI O1 client with explicit max_completion_tokens\nclient OpenAIO1WithMaxCompletionTokens {\n provider openai\n options {\n model \"o1-mini\"\n api_key env.OPENAI_API_KEY\n max_completion_tokens 1000\n }\n}\n\n// OpenAI GPT-4 client with explicit max_tokens\nclient GPT4WithMaxTokens {\n provider openai\n options {\n model \"gpt-4\"\n api_key env.OPENAI_API_KEY\n max_tokens 1000\n }\n}\n", "custom-task.baml" => "class BookOrder {\n orderId string @description(#\"\n The ID of the book order\n \"#)\n title string @description(#\"\n The title of the ordered book\n \"#)\n quantity int @description(#\"\n The quantity of books ordered\n \"#)\n price float @description(#\"\n The price of the book\n \"#)\n}\n\nclass FlightConfirmation {\n confirmationNumber string @description(#\"\n The flight confirmation number\n \"#)\n flightNumber string @description(#\"\n The flight number\n \"#)\n departureTime string @description(#\"\n The scheduled departure time of the flight\n \"#)\n arrivalTime string @description(#\"\n The scheduled arrival time of the flight\n \"#)\n seatNumber string @description(#\"\n The seat number assigned on the flight\n \"#)\n}\n\nclass GroceryReceipt {\n receiptId string @description(#\"\n The ID of the grocery receipt\n \"#)\n storeName string @description(#\"\n The name of the grocery store\n \"#)\n items (string | int | float)[] @description(#\"\n A list of items purchased. Each item consists of a name, quantity, and price.\n \"#)\n totalAmount float @description(#\"\n The total amount spent on groceries\n \"#)\n}\n\nclass CustomTaskResult {\n bookOrder BookOrder | null\n flightConfirmation FlightConfirmation | null\n groceryReceipt GroceryReceipt | null\n}\n\nfunction CustomTask(input: string) -> BookOrder | FlightConfirmation | GroceryReceipt {\n client \"openai/gpt-4o-mini\"\n prompt #\"\n Given the input string, extract either an order for a book, a flight confirmation, or a grocery receipt.\n\n {{ ctx.output_format }}\n\n Input:\n \n {{ input}}\n \"#\n}\n\ntest CustomTask {\n functions [CustomTask]\n args {\n input #\"\nDear [Your Name],\n\nThank you for booking with [Airline Name]! We are pleased to confirm your upcoming flight.\n\nFlight Confirmation Details:\n\nBooking Reference: ABC123\nPassenger Name: [Your Name]\nFlight Number: XY789\nDeparture Date: September 15, 2024\nDeparture Time: 10:30 AM\nArrival Time: 1:45 PM\nDeparture Airport: John F. Kennedy International Airport (JFK), New York, NY\nArrival Airport: Los Angeles International Airport (LAX), Los Angeles, CA\nSeat Number: 12A\nClass: Economy\nBaggage Allowance:\n\nChecked Baggage: 1 piece, up to 23 kg\nCarry-On Baggage: 1 piece, up to 7 kg\nImportant Information:\n\nPlease arrive at the airport at least 2 hours before your scheduled departure.\nCheck-in online via our website or mobile app to save time at the airport.\nEnsure that your identification documents are up to date and match the name on your booking.\nContact Us:\n\nIf you have any questions or need to make changes to your booking, please contact our customer service team at 1-800-123-4567 or email us at support@[airline].com.\n\nWe wish you a pleasant journey and thank you for choosing [Airline Name].\n\nBest regards,\n\n[Airline Name] Customer Service\n \"#\n }\n}", "fiddle-examples/chain-of-thought.baml" => "class Email {\n subject string\n body string\n from_address string\n}\n\nenum OrderStatus {\n ORDERED\n SHIPPED\n DELIVERED\n CANCELLED\n}\n\nclass OrderInfo {\n order_status OrderStatus\n tracking_number string?\n estimated_arrival_date string?\n}\n\nfunction GetOrderInfo(email: Email) -> OrderInfo {\n client GPT4\n prompt #\"\n Given the email below:\n\n ```\n from: {{email.from_address}}\n Email Subject: {{email.subject}}\n Email Body: {{email.body}}\n ```\n\n Extract this info from the email in JSON format:\n {{ ctx.output_format }}\n\n Before you output the JSON, please explain your\n reasoning step-by-step. Here is an example on how to do this:\n 'If we think step by step we can see that ...\n therefore the output JSON is:\n {\n ... the json schema ...\n }'\n \"#\n}", diff --git a/integ-tests/ruby/baml_client/type-registry.rb b/integ-tests/ruby/baml_client/type-registry.rb index 56df1a581..c53988bec 100644 --- a/integ-tests/ruby/baml_client/type-registry.rb +++ b/integ-tests/ruby/baml_client/type-registry.rb @@ -18,14 +18,14 @@ module Baml class TypeBuilder def initialize @registry = Baml::Ffi::TypeBuilder.new - @classes = Set[ "AnotherObject", "BigNumbers", "BinaryNode", "Blah", "BlockConstraint", "BlockConstraintForParam", "BookOrder", "ClassForNullLiteral", "ClassOptionalOutput", "ClassOptionalOutput2", "ClassToRecAlias", "ClassWithBlockDone", "ClassWithImage", "ClassWithoutDone", "ComplexMemoryObject", "CompoundBigNumbers", "ContactInfo", "CustomTaskResult", "DummyOutput", "DynInputOutput", "DynamicClassOne", "DynamicClassTwo", "DynamicOutput", "Earthling", "Education", "Email", "EmailAddress", "Event", "FakeImage", "FlightConfirmation", "FooAny", "Forest", "FormatterTest0", "FormatterTest1", "FormatterTest2", "FormatterTest3", "GroceryReceipt", "InnerClass", "InnerClass2", "InputClass", "InputClassNested", "LinkedList", "LinkedListAliasNode", "LiteralClassHello", "LiteralClassOne", "LiteralClassTwo", "MalformedConstraints", "MalformedConstraints2", "Martian", "MemoryObject", "MergeAttrs", "NamedArgsSingleClass", "Nested", "Nested2", "NestedBlockConstraint", "NestedBlockConstraintForParam", "Node", "NodeWithAliasIndirection", "OptionalListAndMap", "OptionalTest_Prop1", "OptionalTest_ReturnType", "OrderInfo", "OriginalA", "OriginalB", "Person", "PhoneNumber", "Quantity", "RaysData", "ReceiptInfo", "ReceiptItem", "Recipe", "RecursiveAliasDependency", "Resume", "Schema", "SearchParams", "SemanticContainer", "SmallThing", "SomeClassNestedDynamic", "StringToClassEntry", "TestClassAlias", "TestClassNested", "TestClassWithEnum", "TestMemoryOutput", "TestOutputClass", "Tree", "TwoStoriesOneTitle", "UnionTest_ReturnType", "UniverseQuestion", "UniverseQuestionInput", "WithReasoning", ] + @classes = Set[ "AnotherObject", "BigNumbers", "BinaryNode", "Blah", "BlockConstraint", "BlockConstraintForParam", "BookOrder", "ClassForNullLiteral", "ClassOptionalOutput", "ClassOptionalOutput2", "ClassToRecAlias", "ClassWithBlockDone", "ClassWithImage", "ClassWithoutDone", "ComplexMemoryObject", "CompoundBigNumbers", "ContactInfo", "CustomTaskResult", "DummyOutput", "DynInputOutput", "DynamicClassOne", "DynamicClassTwo", "DynamicOutput", "Earthling", "Education", "Email", "EmailAddress", "Event", "FakeImage", "FlightConfirmation", "FooAny", "Forest", "FormatterTest0", "FormatterTest1", "FormatterTest2", "FormatterTest3", "GroceryReceipt", "InnerClass", "InnerClass2", "InputClass", "InputClassNested", "LinkedList", "LinkedListAliasNode", "LiteralClassHello", "LiteralClassOne", "LiteralClassTwo", "MalformedConstraints", "MalformedConstraints2", "Martian", "MemoryObject", "MergeAttrs", "NamedArgsSingleClass", "Nested", "Nested2", "NestedBlockConstraint", "NestedBlockConstraintForParam", "Node", "NodeWithAliasIndirection", "OptionalListAndMap", "OptionalTest_Prop1", "OptionalTest_ReturnType", "OrderInfo", "OriginalA", "OriginalB", "Person", "PhoneNumber", "Quantity", "RaysData", "ReceiptInfo", "ReceiptItem", "Recipe", "RecursiveAliasDependency", "Resume", "Schema", "SearchParams", "SemanticContainer", "SimpleTag", "SmallThing", "SomeClassNestedDynamic", "StringToClassEntry", "TestClassAlias", "TestClassNested", "TestClassWithEnum", "TestMemoryOutput", "TestOutputClass", "Tree", "TwoStoriesOneTitle", "UnionTest_ReturnType", "UniverseQuestion", "UniverseQuestionInput", "WithReasoning", ] @enums = Set[ "AliasedEnum", "Category", "Category2", "Category3", "Color", "DataType", "DynEnumOne", "DynEnumTwo", "EnumInClass", "EnumOutput", "Hobby", "MapKey", "NamedArgsSingleEnum", "NamedArgsSingleEnumList", "OptionalTest_CategoryType", "OrderStatus", "Tag", "TestEnum", ] end def string @registry.string end - + def int @registry.int end @@ -41,7 +41,7 @@ def bool def list(inner_type) @registry.list(inner_type) end - + def null @registry.null end @@ -114,56 +114,56 @@ def add_value(name) end end - + def DummyOutput ClassBuilder.new(@registry, "DummyOutput", Set[ "nonce", "nonce2", ]) end - + def DynInputOutput ClassBuilder.new(@registry, "DynInputOutput", Set[ "testKey", ]) end - + def DynamicClassOne ClassBuilder.new(@registry, "DynamicClassOne", Set[]) end - + def DynamicClassTwo ClassBuilder.new(@registry, "DynamicClassTwo", Set[ "hi", "some_class", "status", ]) end - + def DynamicOutput ClassBuilder.new(@registry, "DynamicOutput", Set[]) end - + def OriginalB ClassBuilder.new(@registry, "OriginalB", Set[ "value", ]) end - + def Person ClassBuilder.new(@registry, "Person", Set[ "name", "hair_color", ]) end - + def SomeClassNestedDynamic ClassBuilder.new(@registry, "SomeClassNestedDynamic", Set[ "hi", ]) end + - - + def Color EnumBuilder.new(@registry, "Color", Set[ "RED", "BLUE", "GREEN", "YELLOW", "BLACK", "WHITE", ]) end - + def DynEnumOne EnumBuilder.new(@registry, "DynEnumOne", Set[]) end - + def DynEnumTwo EnumBuilder.new(@registry, "DynEnumTwo", Set[]) end - + def Hobby EnumBuilder.new(@registry, "Hobby", Set[ "SPORTS", "MUSIC", "READING", ]) end - + end end \ No newline at end of file diff --git a/integ-tests/typescript/baml_client/async_client.ts b/integ-tests/typescript/baml_client/async_client.ts index 50d762df5..052b3215f 100644 --- a/integ-tests/typescript/baml_client/async_client.ts +++ b/integ-tests/typescript/baml_client/async_client.ts @@ -18,7 +18,7 @@ $ pnpm add @boundaryml/baml import { type BamlCtxManager, type BamlRuntime, BamlStream, BamlValidationError, type ClientRegistry, FunctionResult, type Image, createBamlValidationError } from "@boundaryml/baml" import type { Checked, Check, RecursivePartialNull as MovedRecursivePartialNull } from "./types" import type { partial_types } from "./partial_types"; -import type {AliasedEnum, AnotherObject, BigNumbers, BinaryNode, Blah, BlockConstraint, BlockConstraintForParam, BookOrder, Category, Category2, Category3, ClassForNullLiteral, ClassOptionalOutput, ClassOptionalOutput2, ClassToRecAlias, ClassWithBlockDone, ClassWithImage, ClassWithoutDone, Color, ComplexMemoryObject, CompoundBigNumbers, ContactInfo, CustomTaskResult, DataType, DummyOutput, DynEnumOne, DynEnumTwo, DynInputOutput, DynamicClassOne, DynamicClassTwo, DynamicOutput, Earthling, Education, Email, EmailAddress, EnumInClass, EnumOutput, Event, FakeImage, FlightConfirmation, FooAny, Forest, FormatterTest0, FormatterTest1, FormatterTest2, FormatterTest3, GroceryReceipt, Hobby, InnerClass, InnerClass2, InputClass, InputClassNested, JsonArray, JsonObject, JsonValue, LinkedList, LinkedListAliasNode, LiteralClassHello, LiteralClassOne, LiteralClassTwo, MalformedConstraints, MalformedConstraints2, MapKey, Martian, MemoryObject, MergeAttrs, NamedArgsSingleClass, NamedArgsSingleEnum, NamedArgsSingleEnumList, Nested, Nested2, NestedBlockConstraint, NestedBlockConstraintForParam, Node, NodeWithAliasIndirection, OptionalListAndMap, OptionalTest_CategoryType, OptionalTest_Prop1, OptionalTest_ReturnType, OrderInfo, OrderStatus, OriginalA, OriginalB, Person, PhoneNumber, Quantity, RaysData, RecAliasOne, RecAliasThree, RecAliasTwo, ReceiptInfo, ReceiptItem, Recipe, RecursiveAliasDependency, RecursiveListAlias, RecursiveMapAlias, Resume, Schema, SearchParams, SemanticContainer, SmallThing, SomeClassNestedDynamic, StringToClassEntry, Tag, TestClassAlias, TestClassNested, TestClassWithEnum, TestEnum, TestMemoryOutput, TestOutputClass, Tree, TwoStoriesOneTitle, UnionTest_ReturnType, UniverseQuestion, UniverseQuestionInput, WithReasoning} from "./types" +import type {AliasedEnum, AnotherObject, BigNumbers, BinaryNode, Blah, BlockConstraint, BlockConstraintForParam, BookOrder, Category, Category2, Category3, ClassForNullLiteral, ClassOptionalOutput, ClassOptionalOutput2, ClassToRecAlias, ClassWithBlockDone, ClassWithImage, ClassWithoutDone, Color, ComplexMemoryObject, CompoundBigNumbers, ContactInfo, CustomTaskResult, DataType, DummyOutput, DynEnumOne, DynEnumTwo, DynInputOutput, DynamicClassOne, DynamicClassTwo, DynamicOutput, Earthling, Education, Email, EmailAddress, EnumInClass, EnumOutput, Event, FakeImage, FlightConfirmation, FooAny, Forest, FormatterTest0, FormatterTest1, FormatterTest2, FormatterTest3, GroceryReceipt, Hobby, InnerClass, InnerClass2, InputClass, InputClassNested, JsonArray, JsonEntry, JsonObject, JsonTemplate, JsonValue, LinkedList, LinkedListAliasNode, LiteralClassHello, LiteralClassOne, LiteralClassTwo, MalformedConstraints, MalformedConstraints2, MapKey, Martian, MemoryObject, MergeAttrs, NamedArgsSingleClass, NamedArgsSingleEnum, NamedArgsSingleEnumList, Nested, Nested2, NestedBlockConstraint, NestedBlockConstraintForParam, Node, NodeWithAliasIndirection, OptionalListAndMap, OptionalTest_CategoryType, OptionalTest_Prop1, OptionalTest_ReturnType, OrderInfo, OrderStatus, OriginalA, OriginalB, Person, PhoneNumber, Quantity, RaysData, RecAliasOne, RecAliasThree, RecAliasTwo, ReceiptInfo, ReceiptItem, Recipe, RecursiveAliasDependency, RecursiveListAlias, RecursiveMapAlias, Resume, Schema, SearchParams, SemanticContainer, SimpleTag, SmallThing, SomeClassNestedDynamic, StringToClassEntry, Tag, TestClassAlias, TestClassNested, TestClassWithEnum, TestEnum, TestMemoryOutput, TestOutputClass, Tree, TwoStoriesOneTitle, UnionTest_ReturnType, UniverseQuestion, UniverseQuestionInput, WithReasoning} from "./types" import type 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" @@ -42,15 +42,16 @@ export class BamlAsyncClient { return this.stream_client } + async AaaSamOutputFormat( - recipe: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + recipe: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'AaaSamOutputFormat', + "AaaSamOutputFormat", { - recipe: recipe, + "recipe": recipe }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -58,24 +59,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as Recipe } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async AliasThatPointsToRecursiveType( - list: LinkedListAliasNode, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + list: LinkedListAliasNode, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'AliasThatPointsToRecursiveType', + "AliasThatPointsToRecursiveType", { - list: list, + "list": list }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -83,49 +84,49 @@ export class BamlAsyncClient { ) return raw.parsed(false) as LinkedListAliasNode } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async AliasWithMultipleAttrs( - money: Checked, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): Promise> { + money: Checked, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Promise> { try { const raw = await this.runtime.callFunction( - 'AliasWithMultipleAttrs', + "AliasWithMultipleAttrs", { - money: money, + "money": money }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) - return raw.parsed(false) as Checked + return raw.parsed(false) as Checked } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async AliasedInputClass( - input: InputClass, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: InputClass, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'AliasedInputClass', + "AliasedInputClass", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -133,24 +134,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async AliasedInputClass2( - input: InputClass, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: InputClass, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'AliasedInputClass2', + "AliasedInputClass2", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -158,24 +159,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async AliasedInputClassNested( - input: InputClassNested, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: InputClassNested, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'AliasedInputClassNested', + "AliasedInputClassNested", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -183,24 +184,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async AliasedInputEnum( - input: AliasedEnum, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: AliasedEnum, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'AliasedInputEnum', + "AliasedInputEnum", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -208,24 +209,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async AliasedInputList( - input: AliasedEnum[], - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: AliasedEnum[], + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'AliasedInputList', + "AliasedInputList", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -233,24 +234,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async AllowedOptionals( - optionals: OptionalListAndMap, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + optionals: OptionalListAndMap, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'AllowedOptionals', + "AllowedOptionals", { - optionals: optionals, + "optionals": optionals }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -258,21 +259,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as OptionalListAndMap } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - async AssertFn(a: number, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): Promise { + + async AssertFn( + a: number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Promise { try { const raw = await this.runtime.callFunction( - 'AssertFn', + "AssertFn", { - a: a, + "a": a }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -280,24 +284,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as number } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async AudioInput( - aud: Audio, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + aud: Audio, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'AudioInput', + "AudioInput", { - aud: aud, + "aud": aud }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -305,24 +309,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async BuildLinkedList( - input: number[], - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: number[], + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'BuildLinkedList', + "BuildLinkedList", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -330,24 +334,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as LinkedList } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async BuildTree( - input: BinaryNode, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: BinaryNode, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'BuildTree', + "BuildTree", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -355,24 +359,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as Tree } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async ClassThatPointsToRecursiveClassThroughAlias( - cls: ClassToRecAlias, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + cls: ClassToRecAlias, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'ClassThatPointsToRecursiveClassThroughAlias', + "ClassThatPointsToRecursiveClassThroughAlias", { - cls: cls, + "cls": cls }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -380,49 +384,49 @@ export class BamlAsyncClient { ) return raw.parsed(false) as ClassToRecAlias } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async ClassifyDynEnumTwo( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): Promise { + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Promise<(string | DynEnumTwo)> { try { const raw = await this.runtime.callFunction( - 'ClassifyDynEnumTwo', + "ClassifyDynEnumTwo", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) - return raw.parsed(false) as string | DynEnumTwo + return raw.parsed(false) as (string | DynEnumTwo) } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async ClassifyMessage( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'ClassifyMessage', + "ClassifyMessage", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -430,24 +434,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as Category } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async ClassifyMessage2( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'ClassifyMessage2', + "ClassifyMessage2", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -455,24 +459,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as Category } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async ClassifyMessage3( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'ClassifyMessage3', + "ClassifyMessage3", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -480,28 +484,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as Category } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async Completion( - prefix: string, - suffix: string, - language: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + prefix: string,suffix: string,language: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'Completion', + "Completion", { - prefix: prefix, - suffix: suffix, - language: language, + "prefix": prefix,"suffix": suffix,"language": language }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -509,24 +509,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async CustomTask( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'CustomTask', + "CustomTask", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -534,24 +534,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as BookOrder | FlightConfirmation | GroceryReceipt } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async DescribeImage( - img: Image, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + img: Image, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'DescribeImage', + "DescribeImage", { - img: img, + "img": img }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -559,26 +559,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async DescribeImage2( - classWithImage: ClassWithImage, - img2: Image, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + classWithImage: ClassWithImage,img2: Image, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'DescribeImage2', + "DescribeImage2", { - classWithImage: classWithImage, - img2: img2, + "classWithImage": classWithImage,"img2": img2 }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -586,26 +584,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async DescribeImage3( - classWithImage: ClassWithImage, - img2: Image, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + classWithImage: ClassWithImage,img2: Image, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'DescribeImage3', + "DescribeImage3", { - classWithImage: classWithImage, - img2: img2, + "classWithImage": classWithImage,"img2": img2 }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -613,26 +609,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async DescribeImage4( - classWithImage: ClassWithImage, - img2: Image, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + classWithImage: ClassWithImage,img2: Image, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'DescribeImage4', + "DescribeImage4", { - classWithImage: classWithImage, - img2: img2, + "classWithImage": classWithImage,"img2": img2 }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -640,46 +634,49 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - async DifferentiateUnions(__baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): Promise< - OriginalA | OriginalB - > { + + async DifferentiateUnions( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Promise { try { const raw = await this.runtime.callFunction( - 'DifferentiateUnions', - {}, + "DifferentiateUnions", + { + + }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) return raw.parsed(false) as OriginalA | OriginalB } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async DummyOutputFunction( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'DummyOutputFunction', + "DummyOutputFunction", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -687,24 +684,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as DummyOutput } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async DynamicFunc( - input: DynamicClassOne, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: DynamicClassOne, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'DynamicFunc', + "DynamicFunc", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -712,24 +709,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as DynamicClassTwo } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async DynamicInputOutput( - input: DynInputOutput, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: DynInputOutput, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'DynamicInputOutput', + "DynamicInputOutput", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -737,24 +734,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as DynInputOutput } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async DynamicListInputOutput( - input: DynInputOutput[], - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: DynInputOutput[], + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'DynamicListInputOutput', + "DynamicListInputOutput", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -762,44 +759,49 @@ export class BamlAsyncClient { ) return raw.parsed(false) as DynInputOutput[] } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - async ExpectFailure(__baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): Promise { + + async ExpectFailure( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Promise { try { const raw = await this.runtime.callFunction( - 'ExpectFailure', - {}, + "ExpectFailure", + { + + }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async ExtractContactInfo( - document: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + document: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'ExtractContactInfo', + "ExtractContactInfo", { - document: document, + "document": document }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -807,24 +809,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as ContactInfo } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async ExtractHobby( - text: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + text: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise<(string | Hobby)[]> { try { const raw = await this.runtime.callFunction( - 'ExtractHobby', + "ExtractHobby", { - text: text, + "text": text }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -832,24 +834,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as (string | Hobby)[] } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async ExtractNames( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'ExtractNames', + "ExtractNames", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -857,24 +859,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string[] } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async ExtractPeople( - text: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + text: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'ExtractPeople', + "ExtractPeople", { - text: text, + "text": text }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -882,26 +884,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as Person[] } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async ExtractReceiptInfo( - email: string, - reason: 'curiosity' | 'personal_finance', - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + email: string,reason: "curiosity" | "personal_finance", + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'ExtractReceiptInfo', + "ExtractReceiptInfo", { - email: email, - reason: reason, + "email": email,"reason": reason }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -909,26 +909,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as ReceiptInfo } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async ExtractResume( - resume: string, - img?: Image | null, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + resume: string,img?: Image | null, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'ExtractResume', + "ExtractResume", { - resume: resume, - img: img ?? null, + "resume": resume,"img": img?? null }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -936,24 +934,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as Resume } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async ExtractResume2( - resume: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + resume: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'ExtractResume2', + "ExtractResume2", { - resume: resume, + "resume": resume }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -961,24 +959,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as Resume } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async FnClassOptionalOutput( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'FnClassOptionalOutput', + "FnClassOptionalOutput", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -986,24 +984,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as ClassOptionalOutput | null } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async FnClassOptionalOutput2( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'FnClassOptionalOutput2', + "FnClassOptionalOutput2", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1011,24 +1009,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as ClassOptionalOutput2 | null } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async FnEnumListOutput( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'FnEnumListOutput', + "FnEnumListOutput", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1036,24 +1034,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as EnumOutput[] } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async FnEnumOutput( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'FnEnumOutput', + "FnEnumOutput", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1061,24 +1059,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as EnumOutput } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async FnLiteralClassInputOutput( - input: LiteralClassHello, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: LiteralClassHello, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'FnLiteralClassInputOutput', + "FnLiteralClassInputOutput", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1086,24 +1084,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as LiteralClassHello } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async FnLiteralUnionClassInputOutput( - input: LiteralClassOne | LiteralClassTwo, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: LiteralClassOne | LiteralClassTwo, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'FnLiteralUnionClassInputOutput', + "FnLiteralUnionClassInputOutput", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1111,24 +1109,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as LiteralClassOne | LiteralClassTwo } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async FnNamedArgsSingleStringOptional( - myString?: string | null, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myString?: string | null, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'FnNamedArgsSingleStringOptional', + "FnNamedArgsSingleStringOptional", { - myString: myString ?? null, + "myString": myString?? null }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1136,24 +1134,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async FnOutputBool( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'FnOutputBool', + "FnOutputBool", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1161,24 +1159,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as boolean } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async FnOutputClass( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'FnOutputClass', + "FnOutputClass", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1186,24 +1184,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as TestOutputClass } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async FnOutputClassList( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'FnOutputClassList', + "FnOutputClassList", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1211,24 +1209,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as TestOutputClass[] } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async FnOutputClassNested( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'FnOutputClassNested', + "FnOutputClassNested", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1236,24 +1234,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as TestClassNested } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async FnOutputClassWithEnum( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'FnOutputClassWithEnum', + "FnOutputClassWithEnum", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1261,24 +1259,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as TestClassWithEnum } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async FnOutputInt( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'FnOutputInt', + "FnOutputInt", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1286,24 +1284,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as number } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async FnOutputLiteralBool( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'FnOutputLiteralBool', + "FnOutputLiteralBool", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1311,24 +1309,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as false } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async FnOutputLiteralInt( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise<5> { try { const raw = await this.runtime.callFunction( - 'FnOutputLiteralInt', + "FnOutputLiteralInt", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1336,49 +1334,49 @@ export class BamlAsyncClient { ) return raw.parsed(false) as 5 } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async FnOutputLiteralString( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): Promise<'example output'> { + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Promise<"example output"> { try { const raw = await this.runtime.callFunction( - 'FnOutputLiteralString', + "FnOutputLiteralString", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) - return raw.parsed(false) as 'example output' + return raw.parsed(false) as "example output" } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async FnOutputStringList( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'FnOutputStringList', + "FnOutputStringList", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1386,24 +1384,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string[] } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async FnTestAliasedEnumOutput( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'FnTestAliasedEnumOutput', + "FnTestAliasedEnumOutput", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1411,24 +1409,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as TestEnum } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async FnTestClassAlias( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'FnTestClassAlias', + "FnTestClassAlias", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1436,24 +1434,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as TestClassAlias } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async FnTestNamedArgsSingleEnum( - myArg: NamedArgsSingleEnum, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myArg: NamedArgsSingleEnum, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'FnTestNamedArgsSingleEnum', + "FnTestNamedArgsSingleEnum", { - myArg: myArg, + "myArg": myArg }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1461,24 +1459,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async GetDataType( - text: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + text: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'GetDataType', + "GetDataType", { - text: text, + "text": text }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1486,24 +1484,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as RaysData } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async GetOrderInfo( - email: Email, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + email: Email, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'GetOrderInfo', + "GetOrderInfo", { - email: email, + "email": email }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1511,24 +1509,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as OrderInfo } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async GetQuery( - query: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + query: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'GetQuery', + "GetQuery", { - query: query, + "query": query }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1536,26 +1534,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as SearchParams } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async InOutEnumMapKey( - i1: Partial>, - i2: Partial>, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + i1: Partial>,i2: Partial>, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise>> { try { const raw = await this.runtime.callFunction( - 'InOutEnumMapKey', + "InOutEnumMapKey", { - i1: i1, - i2: i2, + "i1": i1,"i2": i2 }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1563,76 +1559,74 @@ export class BamlAsyncClient { ) return raw.parsed(false) as Partial> } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async InOutLiteralStringUnionMapKey( - i1: Partial>, - i2: Partial>, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): Promise>> { + i1: Partial>,i2: Partial>, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Promise>> { try { const raw = await this.runtime.callFunction( - 'InOutLiteralStringUnionMapKey', + "InOutLiteralStringUnionMapKey", { - i1: i1, - i2: i2, + "i1": i1,"i2": i2 }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) - return raw.parsed(false) as Partial> + return raw.parsed(false) as Partial> } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async InOutSingleLiteralStringMapKey( - m: Partial>, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): Promise>> { + m: Partial>, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Promise>> { try { const raw = await this.runtime.callFunction( - 'InOutSingleLiteralStringMapKey', + "InOutSingleLiteralStringMapKey", { - m: m, + "m": m }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) - return raw.parsed(false) as Partial> + return raw.parsed(false) as Partial> } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async JsonTypeAliasCycle( - input: JsonValue, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: JsonValue, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'JsonTypeAliasCycle', + "JsonTypeAliasCycle", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1640,117 +1634,124 @@ export class BamlAsyncClient { ) return raw.parsed(false) as JsonValue } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async LiteralUnionsTest( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): Promise<1 | true | 'string output'> { + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Promise<1 | true | "string output"> { try { const raw = await this.runtime.callFunction( - 'LiteralUnionsTest', + "LiteralUnionsTest", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) - return raw.parsed(false) as 1 | true | 'string output' + return raw.parsed(false) as 1 | true | "string output" } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - async MakeBlockConstraint(__baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): Promise< - Checked - > { + + async MakeBlockConstraint( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Promise> { try { const raw = await this.runtime.callFunction( - 'MakeBlockConstraint', - {}, + "MakeBlockConstraint", + { + + }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) - return raw.parsed(false) as Checked + return raw.parsed(false) as Checked } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - async MakeNestedBlockConstraint(__baml_options__?: { - tb?: TypeBuilder - clientRegistry?: ClientRegistry - }): Promise { + + async MakeNestedBlockConstraint( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Promise { try { const raw = await this.runtime.callFunction( - 'MakeNestedBlockConstraint', - {}, + "MakeNestedBlockConstraint", + { + + }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) return raw.parsed(false) as NestedBlockConstraint } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - async MakeSemanticContainer(__baml_options__?: { - tb?: TypeBuilder - clientRegistry?: ClientRegistry - }): Promise { + + async MakeSemanticContainer( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Promise { try { const raw = await this.runtime.callFunction( - 'MakeSemanticContainer', - {}, + "MakeSemanticContainer", + { + + }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) return raw.parsed(false) as SemanticContainer } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async MapAlias( - m: Record, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + m: Record, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise> { try { const raw = await this.runtime.callFunction( - 'MapAlias', + "MapAlias", { - m: m, + "m": m }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1758,24 +1759,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as Record } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async MergeAliasAttributes( - money: number, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + money: number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'MergeAliasAttributes', + "MergeAliasAttributes", { - money: money, + "money": money }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1783,24 +1784,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as MergeAttrs } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async MyFunc( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'MyFunc', + "MyFunc", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1808,24 +1809,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as DynamicOutput } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async NestedAlias( - c: number | string | boolean | number | string[] | Record, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + c: number | string | boolean | number | string[] | Record, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise> { try { const raw = await this.runtime.callFunction( - 'NestedAlias', + "NestedAlias", { - c: c, + "c": c }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1833,24 +1834,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as number | string | boolean | number | string[] | Record } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async NullLiteralClassHello( - s: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + s: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'NullLiteralClassHello', + "NullLiteralClassHello", { - s: s, + "s": s }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1858,24 +1859,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as ClassForNullLiteral } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async OptionalTest_Function( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise<(OptionalTest_ReturnType | null)[]> { try { const raw = await this.runtime.callFunction( - 'OptionalTest_Function', + "OptionalTest_Function", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1883,24 +1884,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as (OptionalTest_ReturnType | null)[] } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async PredictAge( - name: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + name: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'PredictAge', + "PredictAge", { - name: name, + "name": name }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1908,49 +1909,49 @@ export class BamlAsyncClient { ) return raw.parsed(false) as FooAny } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async PredictAgeBare( - inp: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): Promise> { + inp: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Promise> { try { const raw = await this.runtime.callFunction( - 'PredictAgeBare', + "PredictAgeBare", { - inp: inp, + "inp": inp }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) - return raw.parsed(false) as Checked + return raw.parsed(false) as Checked } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async PrimitiveAlias( - p: number | string | boolean | number, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + p: number | string | boolean | number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'PrimitiveAlias', + "PrimitiveAlias", { - p: p, + "p": p }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1958,24 +1959,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as number | string | boolean | number } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async PromptTestClaude( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'PromptTestClaude', + "PromptTestClaude", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1983,24 +1984,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async PromptTestClaudeChat( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'PromptTestClaudeChat', + "PromptTestClaudeChat", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2008,24 +2009,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async PromptTestClaudeChatNoSystem( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'PromptTestClaudeChatNoSystem', + "PromptTestClaudeChatNoSystem", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2033,24 +2034,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async PromptTestOpenAI( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'PromptTestOpenAI', + "PromptTestOpenAI", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2058,24 +2059,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async PromptTestOpenAIChat( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'PromptTestOpenAIChat', + "PromptTestOpenAIChat", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2083,24 +2084,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async PromptTestOpenAIChatNoSystem( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'PromptTestOpenAIChatNoSystem', + "PromptTestOpenAIChatNoSystem", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2108,24 +2109,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async PromptTestStreaming( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'PromptTestStreaming', + "PromptTestStreaming", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2133,24 +2134,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async RecursiveAliasCycle( - input: RecAliasOne, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: RecAliasOne, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'RecursiveAliasCycle', + "RecursiveAliasCycle", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2158,24 +2159,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as RecAliasOne } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async RecursiveClassWithAliasIndirection( - cls: NodeWithAliasIndirection, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + cls: NodeWithAliasIndirection, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'RecursiveClassWithAliasIndirection', + "RecursiveClassWithAliasIndirection", { - cls: cls, + "cls": cls }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2183,49 +2184,49 @@ export class BamlAsyncClient { ) return raw.parsed(false) as NodeWithAliasIndirection } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async ReturnAliasWithMergedAttributes( - money: Checked, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): Promise> { + money: Checked, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Promise> { try { const raw = await this.runtime.callFunction( - 'ReturnAliasWithMergedAttributes', + "ReturnAliasWithMergedAttributes", { - money: money, + "money": money }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) - return raw.parsed(false) as Checked + return raw.parsed(false) as Checked } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async ReturnFailingAssert( - inp: number, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + inp: number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'ReturnFailingAssert', + "ReturnFailingAssert", { - inp: inp, + "inp": inp }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2233,24 +2234,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as number } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async ReturnJsonEntry( - s: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + s: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'ReturnJsonEntry', + "ReturnJsonEntry", { - s: s, + "s": s }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2258,24 +2259,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as JsonTemplate } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async ReturnMalformedConstraints( - a: number, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + a: number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'ReturnMalformedConstraints', + "ReturnMalformedConstraints", { - a: a, + "a": a }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2283,24 +2284,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as MalformedConstraints } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async SchemaDescriptions( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'SchemaDescriptions', + "SchemaDescriptions", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2308,24 +2309,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as Schema } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async SimpleRecursiveListAlias( - input: RecursiveListAlias, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: RecursiveListAlias, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'SimpleRecursiveListAlias', + "SimpleRecursiveListAlias", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2333,24 +2334,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as RecursiveListAlias } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async SimpleRecursiveMapAlias( - input: RecursiveMapAlias, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: RecursiveMapAlias, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'SimpleRecursiveMapAlias', + "SimpleRecursiveMapAlias", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2358,24 +2359,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as RecursiveMapAlias } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async StreamBigNumbers( - digits: number, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + digits: number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'StreamBigNumbers', + "StreamBigNumbers", { - digits: digits, + "digits": digits }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2383,26 +2384,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as BigNumbers } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async StreamFailingAssertion( - theme: string, - length: number, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + theme: string,length: number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'StreamFailingAssertion', + "StreamFailingAssertion", { - theme: theme, - length: length, + "theme": theme,"length": length }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2410,24 +2409,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as TwoStoriesOneTitle } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async StreamOneBigNumber( - digits: number, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + digits: number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'StreamOneBigNumber', + "StreamOneBigNumber", { - digits: digits, + "digits": digits }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2435,24 +2434,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as number } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async StreamUnionIntegers( - digits: number, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + digits: number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise<(number | string)[]> { try { const raw = await this.runtime.callFunction( - 'StreamUnionIntegers', + "StreamUnionIntegers", { - digits: digits, + "digits": digits }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2460,26 +2459,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as (number | string)[] } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async StreamingCompoundNumbers( - digits: number, - yapping: boolean, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + digits: number,yapping: boolean, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'StreamingCompoundNumbers', + "StreamingCompoundNumbers", { - digits: digits, - yapping: yapping, + "digits": digits,"yapping": yapping }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2487,24 +2484,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as CompoundBigNumbers } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TakeRecAliasDep( - input: RecursiveAliasDependency, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: RecursiveAliasDependency, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TakeRecAliasDep', + "TakeRecAliasDep", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2512,24 +2509,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as RecursiveAliasDependency } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestAnthropic( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestAnthropic', + "TestAnthropic", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2537,24 +2534,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestAnthropicShorthand( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestAnthropicShorthand', + "TestAnthropicShorthand", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2562,24 +2559,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestAws( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestAws', + "TestAws", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2587,24 +2584,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestAwsInvalidAccessKey( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestAwsInvalidAccessKey', + "TestAwsInvalidAccessKey", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2612,24 +2609,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestAwsInvalidProfile( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestAwsInvalidProfile', + "TestAwsInvalidProfile", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2637,24 +2634,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestAwsInvalidRegion( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestAwsInvalidRegion', + "TestAwsInvalidRegion", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2662,24 +2659,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestAwsInvalidSessionToken( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestAwsInvalidSessionToken', + "TestAwsInvalidSessionToken", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2687,24 +2684,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestAzure( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestAzure', + "TestAzure", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2712,24 +2709,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestAzureFailure( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestAzureFailure', + "TestAzureFailure", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2737,24 +2734,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestAzureO1NoMaxTokens( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestAzureO1NoMaxTokens', + "TestAzureO1NoMaxTokens", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2762,24 +2759,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestAzureO1WithMaxCompletionTokens( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestAzureO1WithMaxCompletionTokens', + "TestAzureO1WithMaxCompletionTokens", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2787,24 +2784,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestAzureO1WithMaxTokens( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestAzureO1WithMaxTokens', + "TestAzureO1WithMaxTokens", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2812,24 +2809,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestAzureWithMaxTokens( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestAzureWithMaxTokens', + "TestAzureWithMaxTokens", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2837,26 +2834,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestCaching( - input: string, - not_cached: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string,not_cached: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestCaching', + "TestCaching", { - input: input, - not_cached: not_cached, + "input": input,"not_cached": not_cached }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2864,44 +2859,49 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - async TestFallbackClient(__baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): Promise { + + async TestFallbackClient( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Promise { try { const raw = await this.runtime.callFunction( - 'TestFallbackClient', - {}, + "TestFallbackClient", + { + + }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestFallbackToShorthand( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestFallbackToShorthand', + "TestFallbackToShorthand", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2909,24 +2909,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestFnNamedArgsSingleBool( - myBool: boolean, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myBool: boolean, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestFnNamedArgsSingleBool', + "TestFnNamedArgsSingleBool", { - myBool: myBool, + "myBool": myBool }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2934,24 +2934,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestFnNamedArgsSingleClass( - myArg: NamedArgsSingleClass, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myArg: NamedArgsSingleClass, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestFnNamedArgsSingleClass', + "TestFnNamedArgsSingleClass", { - myArg: myArg, + "myArg": myArg }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2959,24 +2959,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestFnNamedArgsSingleEnumList( - myArg: NamedArgsSingleEnumList[], - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myArg: NamedArgsSingleEnumList[], + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestFnNamedArgsSingleEnumList', + "TestFnNamedArgsSingleEnumList", { - myArg: myArg, + "myArg": myArg }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2984,24 +2984,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestFnNamedArgsSingleFloat( - myFloat: number, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myFloat: number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestFnNamedArgsSingleFloat', + "TestFnNamedArgsSingleFloat", { - myFloat: myFloat, + "myFloat": myFloat }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3009,24 +3009,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestFnNamedArgsSingleInt( - myInt: number, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myInt: number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestFnNamedArgsSingleInt', + "TestFnNamedArgsSingleInt", { - myInt: myInt, + "myInt": myInt }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3034,24 +3034,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestFnNamedArgsSingleMapStringToClass( - myMap: Record, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myMap: Record, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise> { try { const raw = await this.runtime.callFunction( - 'TestFnNamedArgsSingleMapStringToClass', + "TestFnNamedArgsSingleMapStringToClass", { - myMap: myMap, + "myMap": myMap }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3059,24 +3059,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as Record } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestFnNamedArgsSingleMapStringToMap( - myMap: Record>, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myMap: Record>, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise>> { try { const raw = await this.runtime.callFunction( - 'TestFnNamedArgsSingleMapStringToMap', + "TestFnNamedArgsSingleMapStringToMap", { - myMap: myMap, + "myMap": myMap }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3084,24 +3084,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as Record> } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestFnNamedArgsSingleMapStringToString( - myMap: Record, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myMap: Record, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise> { try { const raw = await this.runtime.callFunction( - 'TestFnNamedArgsSingleMapStringToString', + "TestFnNamedArgsSingleMapStringToString", { - myMap: myMap, + "myMap": myMap }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3109,24 +3109,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as Record } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestFnNamedArgsSingleString( - myString: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myString: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestFnNamedArgsSingleString', + "TestFnNamedArgsSingleString", { - myString: myString, + "myString": myString }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3134,24 +3134,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestFnNamedArgsSingleStringArray( - myStringArray: string[], - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myStringArray: string[], + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestFnNamedArgsSingleStringArray', + "TestFnNamedArgsSingleStringArray", { - myStringArray: myStringArray, + "myStringArray": myStringArray }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3159,24 +3159,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestFnNamedArgsSingleStringList( - myArg: string[], - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myArg: string[], + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestFnNamedArgsSingleStringList', + "TestFnNamedArgsSingleStringList", { - myArg: myArg, + "myArg": myArg }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3184,24 +3184,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestGemini( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestGemini', + "TestGemini", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3209,47 +3209,49 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - async TestGeminiOpenAiGeneric(__baml_options__?: { - tb?: TypeBuilder - clientRegistry?: ClientRegistry - }): Promise { + + async TestGeminiOpenAiGeneric( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Promise { try { const raw = await this.runtime.callFunction( - 'TestGeminiOpenAiGeneric', - {}, + "TestGeminiOpenAiGeneric", + { + + }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestGeminiSystem( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestGeminiSystem', + "TestGeminiSystem", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3257,24 +3259,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestGeminiSystemAsChat( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestGeminiSystemAsChat', + "TestGeminiSystemAsChat", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3282,24 +3284,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestImageInput( - img: Image, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + img: Image, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestImageInput', + "TestImageInput", { - img: img, + "img": img }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3307,24 +3309,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestImageInputAnthropic( - img: Image, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + img: Image, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestImageInputAnthropic', + "TestImageInputAnthropic", { - img: img, + "img": img }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3332,24 +3334,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestImageListInput( - imgs: Image[], - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + imgs: Image[], + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestImageListInput', + "TestImageListInput", { - imgs: imgs, + "imgs": imgs }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3357,24 +3359,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestMemory( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestMemory', + "TestMemory", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3382,26 +3384,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as TestMemoryOutput } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestMulticlassNamedArgs( - myArg: NamedArgsSingleClass, - myArg2: NamedArgsSingleClass, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myArg: NamedArgsSingleClass,myArg2: NamedArgsSingleClass, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestMulticlassNamedArgs', + "TestMulticlassNamedArgs", { - myArg: myArg, - myArg2: myArg2, + "myArg": myArg,"myArg2": myArg2 }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3409,24 +3409,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestNamedArgsLiteralBool( - myBool: true, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myBool: true, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestNamedArgsLiteralBool', + "TestNamedArgsLiteralBool", { - myBool: myBool, + "myBool": myBool }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3434,24 +3434,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestNamedArgsLiteralInt( - myInt: 1, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myInt: 1, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestNamedArgsLiteralInt', + "TestNamedArgsLiteralInt", { - myInt: myInt, + "myInt": myInt }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3459,24 +3459,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestNamedArgsLiteralString( - myString: 'My String', - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myString: "My String", + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestNamedArgsLiteralString', + "TestNamedArgsLiteralString", { - myString: myString, + "myString": myString }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3484,24 +3484,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestOllama( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestOllama', + "TestOllama", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3509,24 +3509,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestOpenAI( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestOpenAI', + "TestOpenAI", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3534,24 +3534,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestOpenAILegacyProvider( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestOpenAILegacyProvider', + "TestOpenAILegacyProvider", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3559,24 +3559,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestOpenAIO1NoMaxTokens( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestOpenAIO1NoMaxTokens', + "TestOpenAIO1NoMaxTokens", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3584,24 +3584,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestOpenAIO1WithMaxCompletionTokens( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestOpenAIO1WithMaxCompletionTokens', + "TestOpenAIO1WithMaxCompletionTokens", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3609,24 +3609,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestOpenAIO1WithMaxTokens( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestOpenAIO1WithMaxTokens', + "TestOpenAIO1WithMaxTokens", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3634,24 +3634,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestOpenAIShorthand( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestOpenAIShorthand', + "TestOpenAIShorthand", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3659,24 +3659,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestOpenAIWithMaxTokens( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestOpenAIWithMaxTokens', + "TestOpenAIWithMaxTokens", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3684,24 +3684,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestOpenAIWithNullMaxTokens( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestOpenAIWithNullMaxTokens', + "TestOpenAIWithNullMaxTokens", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3709,90 +3709,99 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - async TestRetryConstant(__baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): Promise { + + async TestRetryConstant( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Promise { try { const raw = await this.runtime.callFunction( - 'TestRetryConstant', - {}, + "TestRetryConstant", + { + + }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - async TestRetryExponential(__baml_options__?: { - tb?: TypeBuilder - clientRegistry?: ClientRegistry - }): Promise { + + async TestRetryExponential( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Promise { try { const raw = await this.runtime.callFunction( - 'TestRetryExponential', - {}, + "TestRetryExponential", + { + + }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - async TestSingleFallbackClient(__baml_options__?: { - tb?: TypeBuilder - clientRegistry?: ClientRegistry - }): Promise { + + async TestSingleFallbackClient( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Promise { try { const raw = await this.runtime.callFunction( - 'TestSingleFallbackClient', - {}, + "TestSingleFallbackClient", + { + + }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestUniverseQuestion( - question: UniverseQuestionInput, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + question: UniverseQuestionInput, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestUniverseQuestion', + "TestUniverseQuestion", { - question: question, + "question": question }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3800,24 +3809,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as UniverseQuestion } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async TestVertex( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'TestVertex', + "TestVertex", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3825,47 +3834,49 @@ export class BamlAsyncClient { ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - async TestVertexWithSystemInstructions(__baml_options__?: { - tb?: TypeBuilder - clientRegistry?: ClientRegistry - }): Promise { + + async TestVertexWithSystemInstructions( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Promise { try { const raw = await this.runtime.callFunction( - 'TestVertexWithSystemInstructions', - {}, + "TestVertexWithSystemInstructions", + { + + }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async UnionTest_Function( - input: string | boolean, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string | boolean, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'UnionTest_Function', + "UnionTest_Function", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3873,24 +3884,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as UnionTest_ReturnType } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async UseBlockConstraint( - inp: BlockConstraintForParam, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + inp: BlockConstraintForParam, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'UseBlockConstraint', + "UseBlockConstraint", { - inp: inp, + "inp": inp }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3898,24 +3909,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as number } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async UseMalformedConstraints( - a: MalformedConstraints2, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + a: MalformedConstraints2, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'UseMalformedConstraints', + "UseMalformedConstraints", { - a: a, + "a": a }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3923,24 +3934,24 @@ export class BamlAsyncClient { ) return raw.parsed(false) as number } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + async UseNestedBlockConstraint( - inp: NestedBlockConstraintForParam, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + inp: NestedBlockConstraintForParam, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Promise { try { const raw = await this.runtime.callFunction( - 'UseNestedBlockConstraint', + "UseNestedBlockConstraint", { - inp: inp, + "inp": inp }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -3948,31 +3959,30 @@ export class BamlAsyncClient { ) return raw.parsed(false) as number } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } + } class BamlStreamClient { - constructor( - private runtime: BamlRuntime, - private ctx_manager: BamlCtxManager, - ) {} + constructor(private runtime: BamlRuntime, private ctx_manager: BamlCtxManager) {} + AaaSamOutputFormat( - recipe: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + recipe: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'AaaSamOutputFormat', + "AaaSamOutputFormat", { - recipe: recipe, + "recipe": recipe }, undefined, this.ctx_manager.cloneContext(), @@ -3988,24 +3998,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + AliasThatPointsToRecursiveType( - list: LinkedListAliasNode, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + list: LinkedListAliasNode, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'AliasThatPointsToRecursiveType', + "AliasThatPointsToRecursiveType", { - list: list, + "list": list }, undefined, this.ctx_manager.cloneContext(), @@ -4021,57 +4031,57 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + AliasWithMultipleAttrs( - money: Checked, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): BamlStream, Checked> { + money: Checked, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): BamlStream, Checked> { try { const raw = this.runtime.streamFunction( - 'AliasWithMultipleAttrs', + "AliasWithMultipleAttrs", { - money: money, + "money": money }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) - return new BamlStream, Checked>( + return new BamlStream, Checked>( raw, - (a): a is Checked => a, - (a): a is Checked => a, + (a): a is Checked => a, + (a): a is Checked => a, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + AliasedInputClass( - input: InputClass, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: InputClass, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'AliasedInputClass', + "AliasedInputClass", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -4087,24 +4097,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + AliasedInputClass2( - input: InputClass, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: InputClass, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'AliasedInputClass2', + "AliasedInputClass2", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -4120,24 +4130,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + AliasedInputClassNested( - input: InputClassNested, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: InputClassNested, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'AliasedInputClassNested', + "AliasedInputClassNested", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -4153,24 +4163,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + AliasedInputEnum( - input: AliasedEnum, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: AliasedEnum, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'AliasedInputEnum', + "AliasedInputEnum", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -4186,24 +4196,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + AliasedInputList( - input: AliasedEnum[], - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: AliasedEnum[], + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'AliasedInputList', + "AliasedInputList", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -4219,24 +4229,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + AllowedOptionals( - optionals: OptionalListAndMap, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + optionals: OptionalListAndMap, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'AllowedOptionals', + "AllowedOptionals", { - optionals: optionals, + "optionals": optionals }, undefined, this.ctx_manager.cloneContext(), @@ -4252,24 +4262,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + AssertFn( - a: number, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + a: number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'AssertFn', + "AssertFn", { - a: a, + "a": a }, undefined, this.ctx_manager.cloneContext(), @@ -4285,24 +4295,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + AudioInput( - aud: Audio, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + aud: Audio, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'AudioInput', + "AudioInput", { - aud: aud, + "aud": aud }, undefined, this.ctx_manager.cloneContext(), @@ -4318,24 +4328,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + BuildLinkedList( - input: number[], - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: number[], + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'BuildLinkedList', + "BuildLinkedList", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -4351,24 +4361,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + BuildTree( - input: BinaryNode, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: BinaryNode, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'BuildTree', + "BuildTree", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -4384,24 +4394,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + ClassThatPointsToRecursiveClassThroughAlias( - cls: ClassToRecAlias, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + cls: ClassToRecAlias, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'ClassThatPointsToRecursiveClassThroughAlias', + "ClassThatPointsToRecursiveClassThroughAlias", { - cls: cls, + "cls": cls }, undefined, this.ctx_manager.cloneContext(), @@ -4417,57 +4427,57 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + ClassifyDynEnumTwo( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): BamlStream { + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): BamlStream<(string | DynEnumTwo), (string | DynEnumTwo)> { try { const raw = this.runtime.streamFunction( - 'ClassifyDynEnumTwo', + "ClassifyDynEnumTwo", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) - return new BamlStream( + return new BamlStream<(string | DynEnumTwo), (string | DynEnumTwo)>( raw, - (a): a is string | DynEnumTwo => a, - (a): a is string | DynEnumTwo => a, + (a): a is (string | DynEnumTwo) => a, + (a): a is (string | DynEnumTwo) => a, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + ClassifyMessage( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'ClassifyMessage', + "ClassifyMessage", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -4483,24 +4493,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + ClassifyMessage2( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'ClassifyMessage2', + "ClassifyMessage2", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -4516,24 +4526,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + ClassifyMessage3( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'ClassifyMessage3', + "ClassifyMessage3", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -4549,28 +4559,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + Completion( - prefix: string, - suffix: string, - language: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + prefix: string,suffix: string,language: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'Completion', + "Completion", { - prefix: prefix, - suffix: suffix, - language: language, + "prefix": prefix,"suffix": suffix,"language": language }, undefined, this.ctx_manager.cloneContext(), @@ -4586,72 +4592,57 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + CustomTask( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): BamlStream< - | (partial_types.BookOrder | null) - | (partial_types.FlightConfirmation | null) - | (partial_types.GroceryReceipt | null), - BookOrder | FlightConfirmation | GroceryReceipt - > { + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): BamlStream<((partial_types.BookOrder | null) | (partial_types.FlightConfirmation | null) | (partial_types.GroceryReceipt | null)), BookOrder | FlightConfirmation | GroceryReceipt> { try { const raw = this.runtime.streamFunction( - 'CustomTask', + "CustomTask", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) - return new BamlStream< - | (partial_types.BookOrder | null) - | (partial_types.FlightConfirmation | null) - | (partial_types.GroceryReceipt | null), - BookOrder | FlightConfirmation | GroceryReceipt - >( + return new BamlStream<((partial_types.BookOrder | null) | (partial_types.FlightConfirmation | null) | (partial_types.GroceryReceipt | null)), BookOrder | FlightConfirmation | GroceryReceipt>( raw, - ( - a, - ): a is - | (partial_types.BookOrder | null) - | (partial_types.FlightConfirmation | null) - | (partial_types.GroceryReceipt | null) => a, + (a): a is ((partial_types.BookOrder | null) | (partial_types.FlightConfirmation | null) | (partial_types.GroceryReceipt | null)) => a, (a): a is BookOrder | FlightConfirmation | GroceryReceipt => a, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + DescribeImage( - img: Image, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + img: Image, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'DescribeImage', + "DescribeImage", { - img: img, + "img": img }, undefined, this.ctx_manager.cloneContext(), @@ -4667,26 +4658,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + DescribeImage2( - classWithImage: ClassWithImage, - img2: Image, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + classWithImage: ClassWithImage,img2: Image, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'DescribeImage2', + "DescribeImage2", { - classWithImage: classWithImage, - img2: img2, + "classWithImage": classWithImage,"img2": img2 }, undefined, this.ctx_manager.cloneContext(), @@ -4702,26 +4691,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + DescribeImage3( - classWithImage: ClassWithImage, - img2: Image, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + classWithImage: ClassWithImage,img2: Image, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'DescribeImage3', + "DescribeImage3", { - classWithImage: classWithImage, - img2: img2, + "classWithImage": classWithImage,"img2": img2 }, undefined, this.ctx_manager.cloneContext(), @@ -4737,26 +4724,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + DescribeImage4( - classWithImage: ClassWithImage, - img2: Image, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + classWithImage: ClassWithImage,img2: Image, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'DescribeImage4', + "DescribeImage4", { - classWithImage: classWithImage, - img2: img2, + "classWithImage": classWithImage,"img2": img2 }, undefined, this.ctx_manager.cloneContext(), @@ -4772,55 +4757,57 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - - DifferentiateUnions(__baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): BamlStream< - (partial_types.OriginalA | null) | (partial_types.OriginalB | null), - OriginalA | OriginalB - > { + + DifferentiateUnions( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): BamlStream<((partial_types.OriginalA | null) | (partial_types.OriginalB | null)), OriginalA | OriginalB> { try { const raw = this.runtime.streamFunction( - 'DifferentiateUnions', - {}, + "DifferentiateUnions", + { + + }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) - return new BamlStream<(partial_types.OriginalA | null) | (partial_types.OriginalB | null), OriginalA | OriginalB>( + return new BamlStream<((partial_types.OriginalA | null) | (partial_types.OriginalB | null)), OriginalA | OriginalB>( raw, - (a): a is (partial_types.OriginalA | null) | (partial_types.OriginalB | null) => a, + (a): a is ((partial_types.OriginalA | null) | (partial_types.OriginalB | null)) => a, (a): a is OriginalA | OriginalB => a, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + DummyOutputFunction( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'DummyOutputFunction', + "DummyOutputFunction", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -4836,24 +4823,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + DynamicFunc( - input: DynamicClassOne, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: DynamicClassOne, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'DynamicFunc', + "DynamicFunc", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -4869,24 +4856,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + DynamicInputOutput( - input: DynInputOutput, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: DynInputOutput, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'DynamicInputOutput', + "DynamicInputOutput", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -4902,24 +4889,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + DynamicListInputOutput( - input: DynInputOutput[], - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: DynInputOutput[], + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream<(partial_types.DynInputOutput | null)[], DynInputOutput[]> { try { const raw = this.runtime.streamFunction( - 'DynamicListInputOutput', + "DynamicListInputOutput", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -4935,20 +4922,25 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - - ExpectFailure(__baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): BamlStream { + + ExpectFailure( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): BamlStream { try { const raw = this.runtime.streamFunction( - 'ExpectFailure', - {}, + "ExpectFailure", + { + + }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -4963,24 +4955,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + ExtractContactInfo( - document: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + document: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'ExtractContactInfo', + "ExtractContactInfo", { - document: document, + "document": document }, undefined, this.ctx_manager.cloneContext(), @@ -4996,24 +4988,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + ExtractHobby( - text: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + text: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream<(string | Hobby | null)[], (string | Hobby)[]> { try { const raw = this.runtime.streamFunction( - 'ExtractHobby', + "ExtractHobby", { - text: text, + "text": text }, undefined, this.ctx_manager.cloneContext(), @@ -5029,24 +5021,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + ExtractNames( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream<(string | null)[], string[]> { try { const raw = this.runtime.streamFunction( - 'ExtractNames', + "ExtractNames", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -5062,24 +5054,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + ExtractPeople( - text: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + text: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream<(partial_types.Person | null)[], Person[]> { try { const raw = this.runtime.streamFunction( - 'ExtractPeople', + "ExtractPeople", { - text: text, + "text": text }, undefined, this.ctx_manager.cloneContext(), @@ -5095,26 +5087,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + ExtractReceiptInfo( - email: string, - reason: 'curiosity' | 'personal_finance', - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + email: string,reason: "curiosity" | "personal_finance", + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'ExtractReceiptInfo', + "ExtractReceiptInfo", { - email: email, - reason: reason, + "email": email,"reason": reason }, undefined, this.ctx_manager.cloneContext(), @@ -5130,26 +5120,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + ExtractResume( - resume: string, - img?: Image | null, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + resume: string,img?: Image | null, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'ExtractResume', + "ExtractResume", { - resume: resume, - img: img ?? null, + "resume": resume,"img": img ?? null }, undefined, this.ctx_manager.cloneContext(), @@ -5165,24 +5153,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + ExtractResume2( - resume: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + resume: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'ExtractResume2', + "ExtractResume2", { - resume: resume, + "resume": resume }, undefined, this.ctx_manager.cloneContext(), @@ -5198,90 +5186,90 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + FnClassOptionalOutput( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): BamlStream<(partial_types.ClassOptionalOutput | null) | null, ClassOptionalOutput | null> { + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): BamlStream<((partial_types.ClassOptionalOutput | null) | null), ClassOptionalOutput | null> { try { const raw = this.runtime.streamFunction( - 'FnClassOptionalOutput', + "FnClassOptionalOutput", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) - return new BamlStream<(partial_types.ClassOptionalOutput | null) | null, ClassOptionalOutput | null>( + return new BamlStream<((partial_types.ClassOptionalOutput | null) | null), ClassOptionalOutput | null>( raw, - (a): a is (partial_types.ClassOptionalOutput | null) | null => a, + (a): a is ((partial_types.ClassOptionalOutput | null) | null) => a, (a): a is ClassOptionalOutput | null => a, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + FnClassOptionalOutput2( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): BamlStream<(partial_types.ClassOptionalOutput2 | null) | null, ClassOptionalOutput2 | null> { + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): BamlStream<((partial_types.ClassOptionalOutput2 | null) | null), ClassOptionalOutput2 | null> { try { const raw = this.runtime.streamFunction( - 'FnClassOptionalOutput2', + "FnClassOptionalOutput2", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) - return new BamlStream<(partial_types.ClassOptionalOutput2 | null) | null, ClassOptionalOutput2 | null>( + return new BamlStream<((partial_types.ClassOptionalOutput2 | null) | null), ClassOptionalOutput2 | null>( raw, - (a): a is (partial_types.ClassOptionalOutput2 | null) | null => a, + (a): a is ((partial_types.ClassOptionalOutput2 | null) | null) => a, (a): a is ClassOptionalOutput2 | null => a, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + FnEnumListOutput( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream<(EnumOutput | null)[], EnumOutput[]> { try { const raw = this.runtime.streamFunction( - 'FnEnumListOutput', + "FnEnumListOutput", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -5297,24 +5285,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + FnEnumOutput( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'FnEnumOutput', + "FnEnumOutput", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -5330,24 +5318,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + FnLiteralClassInputOutput( - input: LiteralClassHello, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: LiteralClassHello, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'FnLiteralClassInputOutput', + "FnLiteralClassInputOutput", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -5363,63 +5351,57 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + FnLiteralUnionClassInputOutput( - input: LiteralClassOne | LiteralClassTwo, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): BamlStream< - (partial_types.LiteralClassOne | null) | (partial_types.LiteralClassTwo | null), - LiteralClassOne | LiteralClassTwo - > { + input: LiteralClassOne | LiteralClassTwo, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): BamlStream<((partial_types.LiteralClassOne | null) | (partial_types.LiteralClassTwo | null)), LiteralClassOne | LiteralClassTwo> { try { const raw = this.runtime.streamFunction( - 'FnLiteralUnionClassInputOutput', + "FnLiteralUnionClassInputOutput", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) - return new BamlStream< - (partial_types.LiteralClassOne | null) | (partial_types.LiteralClassTwo | null), - LiteralClassOne | LiteralClassTwo - >( + return new BamlStream<((partial_types.LiteralClassOne | null) | (partial_types.LiteralClassTwo | null)), LiteralClassOne | LiteralClassTwo>( raw, - (a): a is (partial_types.LiteralClassOne | null) | (partial_types.LiteralClassTwo | null) => a, + (a): a is ((partial_types.LiteralClassOne | null) | (partial_types.LiteralClassTwo | null)) => a, (a): a is LiteralClassOne | LiteralClassTwo => a, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + FnNamedArgsSingleStringOptional( - myString?: string | null, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myString?: string | null, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'FnNamedArgsSingleStringOptional', + "FnNamedArgsSingleStringOptional", { - myString: myString ?? null, + "myString": myString ?? null }, undefined, this.ctx_manager.cloneContext(), @@ -5435,24 +5417,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + FnOutputBool( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'FnOutputBool', + "FnOutputBool", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -5468,24 +5450,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + FnOutputClass( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'FnOutputClass', + "FnOutputClass", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -5501,24 +5483,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + FnOutputClassList( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream<(partial_types.TestOutputClass | null)[], TestOutputClass[]> { try { const raw = this.runtime.streamFunction( - 'FnOutputClassList', + "FnOutputClassList", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -5534,24 +5516,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + FnOutputClassNested( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'FnOutputClassNested', + "FnOutputClassNested", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -5567,24 +5549,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + FnOutputClassWithEnum( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'FnOutputClassWithEnum', + "FnOutputClassWithEnum", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -5600,24 +5582,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + FnOutputInt( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'FnOutputInt', + "FnOutputInt", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -5633,24 +5615,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + FnOutputLiteralBool( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'FnOutputLiteralBool', + "FnOutputLiteralBool", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -5666,24 +5648,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + FnOutputLiteralInt( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream<5, 5> { try { const raw = this.runtime.streamFunction( - 'FnOutputLiteralInt', + "FnOutputLiteralInt", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -5699,57 +5681,57 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + FnOutputLiteralString( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): BamlStream<'example output', 'example output'> { + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): BamlStream<"example output", "example output"> { try { const raw = this.runtime.streamFunction( - 'FnOutputLiteralString', + "FnOutputLiteralString", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) - return new BamlStream<'example output', 'example output'>( + return new BamlStream<"example output", "example output">( raw, - (a): a is 'example output' => a, - (a): a is 'example output' => a, + (a): a is "example output" => a, + (a): a is "example output" => a, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + FnOutputStringList( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream<(string | null)[], string[]> { try { const raw = this.runtime.streamFunction( - 'FnOutputStringList', + "FnOutputStringList", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -5765,24 +5747,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + FnTestAliasedEnumOutput( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'FnTestAliasedEnumOutput', + "FnTestAliasedEnumOutput", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -5798,24 +5780,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + FnTestClassAlias( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'FnTestClassAlias', + "FnTestClassAlias", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -5831,24 +5813,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + FnTestNamedArgsSingleEnum( - myArg: NamedArgsSingleEnum, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myArg: NamedArgsSingleEnum, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'FnTestNamedArgsSingleEnum', + "FnTestNamedArgsSingleEnum", { - myArg: myArg, + "myArg": myArg }, undefined, this.ctx_manager.cloneContext(), @@ -5864,24 +5846,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + GetDataType( - text: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + text: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'GetDataType', + "GetDataType", { - text: text, + "text": text }, undefined, this.ctx_manager.cloneContext(), @@ -5897,24 +5879,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + GetOrderInfo( - email: Email, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + email: Email, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'GetOrderInfo', + "GetOrderInfo", { - email: email, + "email": email }, undefined, this.ctx_manager.cloneContext(), @@ -5930,24 +5912,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + GetQuery( - query: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + query: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'GetQuery', + "GetQuery", { - query: query, + "query": query }, undefined, this.ctx_manager.cloneContext(), @@ -5963,133 +5945,123 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + InOutEnumMapKey( - i1: Partial>, - i2: Partial>, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): BamlStream, Partial>> { + i1: Partial>,i2: Partial>, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): BamlStream<(Record ), Partial>> { try { const raw = this.runtime.streamFunction( - 'InOutEnumMapKey', + "InOutEnumMapKey", { - i1: i1, - i2: i2, + "i1": i1,"i2": i2 }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) - return new BamlStream, Partial>>( + return new BamlStream<(Record ), Partial>>( raw, - (a): a is Record => a, + (a): a is (Record ) => a, (a): a is Partial> => a, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + InOutLiteralStringUnionMapKey( - i1: Partial>, - i2: Partial>, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): BamlStream< - Record<'one' | 'two' | 'three' | 'four', string | null>, - Partial> - > { + i1: Partial>,i2: Partial>, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): BamlStream<(Record<"one" | "two" | "three" | "four", (string | null)> ), Partial>> { try { const raw = this.runtime.streamFunction( - 'InOutLiteralStringUnionMapKey', + "InOutLiteralStringUnionMapKey", { - i1: i1, - i2: i2, + "i1": i1,"i2": i2 }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) - return new BamlStream< - Record<'one' | 'two' | 'three' | 'four', string | null>, - Partial> - >( + return new BamlStream<(Record<"one" | "two" | "three" | "four", (string | null)> ), Partial>>( raw, - (a): a is Record<'one' | 'two' | 'three' | 'four', string | null> => a, - (a): a is Partial> => a, + (a): a is (Record<"one" | "two" | "three" | "four", (string | null)> ) => a, + (a): a is Partial> => a, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + InOutSingleLiteralStringMapKey( - m: Partial>, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): BamlStream, Partial>> { + m: Partial>, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): BamlStream<(Record<"key", (string | null)> ), Partial>> { try { const raw = this.runtime.streamFunction( - 'InOutSingleLiteralStringMapKey', + "InOutSingleLiteralStringMapKey", { - m: m, + "m": m }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) - return new BamlStream, Partial>>( + return new BamlStream<(Record<"key", (string | null)> ), Partial>>( raw, - (a): a is Record<'key', string | null> => a, - (a): a is Partial> => a, + (a): a is (Record<"key", (string | null)> ) => a, + (a): a is Partial> => a, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + JsonTypeAliasCycle( - input: JsonValue, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: JsonValue, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'JsonTypeAliasCycle', + "JsonTypeAliasCycle", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -6105,90 +6077,91 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + LiteralUnionsTest( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): BamlStream<1 | true | 'string output', 1 | true | 'string output'> { + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): BamlStream<(1 | true | "string output"), 1 | true | "string output"> { try { const raw = this.runtime.streamFunction( - 'LiteralUnionsTest', + "LiteralUnionsTest", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) - return new BamlStream<1 | true | 'string output', 1 | true | 'string output'>( + return new BamlStream<(1 | true | "string output"), 1 | true | "string output">( raw, - (a): a is 1 | true | 'string output' => a, - (a): a is 1 | true | 'string output' => a, + (a): a is (1 | true | "string output") => a, + (a): a is 1 | true | "string output" => a, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - - MakeBlockConstraint(__baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): BamlStream< - Checked, - Checked - > { + + MakeBlockConstraint( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): BamlStream, Checked> { try { const raw = this.runtime.streamFunction( - 'MakeBlockConstraint', - {}, + "MakeBlockConstraint", + { + + }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) - return new BamlStream< - Checked, - Checked - >( + return new BamlStream, Checked>( raw, - (a): a is Checked => a, - (a): a is Checked => a, + (a): a is Checked => a, + (a): a is Checked => a, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - - MakeNestedBlockConstraint(__baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): BamlStream< - partial_types.NestedBlockConstraint, - NestedBlockConstraint - > { + + MakeNestedBlockConstraint( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): BamlStream { try { const raw = this.runtime.streamFunction( - 'MakeNestedBlockConstraint', - {}, + "MakeNestedBlockConstraint", + { + + }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -6203,23 +6176,25 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - - MakeSemanticContainer(__baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): BamlStream< - partial_types.SemanticContainer, - SemanticContainer - > { + + MakeSemanticContainer( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): BamlStream { try { const raw = this.runtime.streamFunction( - 'MakeSemanticContainer', - {}, + "MakeSemanticContainer", + { + + }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -6234,57 +6209,57 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + MapAlias( - m: Record, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): BamlStream, Record> { + m: Record, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): BamlStream<(Record ), Record> { try { const raw = this.runtime.streamFunction( - 'MapAlias', + "MapAlias", { - m: m, + "m": m }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) - return new BamlStream, Record>( + return new BamlStream<(Record ), Record>( raw, - (a): a is Record => a, + (a): a is (Record ) => a, (a): a is Record => a, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + MergeAliasAttributes( - money: number, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + money: number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'MergeAliasAttributes', + "MergeAliasAttributes", { - money: money, + "money": money }, undefined, this.ctx_manager.cloneContext(), @@ -6300,24 +6275,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + MyFunc( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'MyFunc', + "MyFunc", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -6333,72 +6308,57 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + NestedAlias( - c: number | string | boolean | number | string[] | Record, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): BamlStream< - | ((number | null) | (string | null) | (boolean | null) | (number | null) | null) - | (string | null)[] - | (Record | null), - number | string | boolean | number | string[] | Record - > { + c: number | string | boolean | number | string[] | Record, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): BamlStream<(((number | null) | (string | null) | (boolean | null) | (number | null) | null) | (string | null)[] | (Record | null)), number | string | boolean | number | string[] | Record> { try { const raw = this.runtime.streamFunction( - 'NestedAlias', + "NestedAlias", { - c: c, + "c": c }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) - return new BamlStream< - | ((number | null) | (string | null) | (boolean | null) | (number | null) | null) - | (string | null)[] - | (Record | null), - number | string | boolean | number | string[] | Record - >( + return new BamlStream<(((number | null) | (string | null) | (boolean | null) | (number | null) | null) | (string | null)[] | (Record | null)), number | string | boolean | number | string[] | Record>( raw, - ( - a, - ): a is - | ((number | null) | (string | null) | (boolean | null) | (number | null) | null) - | (string | null)[] - | (Record | null) => a, + (a): a is (((number | null) | (string | null) | (boolean | null) | (number | null) | null) | (string | null)[] | (Record | null)) => a, (a): a is number | string | boolean | number | string[] | Record => a, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + NullLiteralClassHello( - s: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + s: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'NullLiteralClassHello', + "NullLiteralClassHello", { - s: s, + "s": s }, undefined, this.ctx_manager.cloneContext(), @@ -6414,34 +6374,31 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + OptionalTest_Function( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream<((partial_types.OptionalTest_ReturnType | null) | null)[], (OptionalTest_ReturnType | null)[]> { try { const raw = this.runtime.streamFunction( - 'OptionalTest_Function', + "OptionalTest_Function", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) - return new BamlStream< - ((partial_types.OptionalTest_ReturnType | null) | null)[], - (OptionalTest_ReturnType | null)[] - >( + return new BamlStream<((partial_types.OptionalTest_ReturnType | null) | null)[], (OptionalTest_ReturnType | null)[]>( raw, (a): a is ((partial_types.OptionalTest_ReturnType | null) | null)[] => a, (a): a is (OptionalTest_ReturnType | null)[] => a, @@ -6450,24 +6407,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + PredictAge( - name: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + name: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'PredictAge', + "PredictAge", { - name: name, + "name": name }, undefined, this.ctx_manager.cloneContext(), @@ -6483,96 +6440,90 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + PredictAgeBare( - inp: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): BamlStream, Checked> { + inp: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): BamlStream, Checked> { try { const raw = this.runtime.streamFunction( - 'PredictAgeBare', + "PredictAgeBare", { - inp: inp, + "inp": inp }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) - return new BamlStream, Checked>( + return new BamlStream, Checked>( raw, - (a): a is Checked => a, - (a): a is Checked => a, + (a): a is Checked => a, + (a): a is Checked => a, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + PrimitiveAlias( - p: number | string | boolean | number, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): BamlStream< - (number | null) | (string | null) | (boolean | null) | (number | null), - number | string | boolean | number - > { + p: number | string | boolean | number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): BamlStream<((number | null) | (string | null) | (boolean | null) | (number | null)), number | string | boolean | number> { try { const raw = this.runtime.streamFunction( - 'PrimitiveAlias', + "PrimitiveAlias", { - p: p, + "p": p }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) - return new BamlStream< - (number | null) | (string | null) | (boolean | null) | (number | null), - number | string | boolean | number - >( + return new BamlStream<((number | null) | (string | null) | (boolean | null) | (number | null)), number | string | boolean | number>( raw, - (a): a is (number | null) | (string | null) | (boolean | null) | (number | null) => a, + (a): a is ((number | null) | (string | null) | (boolean | null) | (number | null)) => a, (a): a is number | string | boolean | number => a, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + PromptTestClaude( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'PromptTestClaude', + "PromptTestClaude", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -6588,24 +6539,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + PromptTestClaudeChat( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'PromptTestClaudeChat', + "PromptTestClaudeChat", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -6621,24 +6572,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + PromptTestClaudeChatNoSystem( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'PromptTestClaudeChatNoSystem', + "PromptTestClaudeChatNoSystem", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -6654,24 +6605,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + PromptTestOpenAI( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'PromptTestOpenAI', + "PromptTestOpenAI", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -6687,24 +6638,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + PromptTestOpenAIChat( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'PromptTestOpenAIChat', + "PromptTestOpenAIChat", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -6720,24 +6671,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + PromptTestOpenAIChatNoSystem( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'PromptTestOpenAIChatNoSystem', + "PromptTestOpenAIChatNoSystem", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -6753,24 +6704,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + PromptTestStreaming( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'PromptTestStreaming', + "PromptTestStreaming", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -6786,24 +6737,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + RecursiveAliasCycle( - input: RecAliasOne, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: RecAliasOne, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'RecursiveAliasCycle', + "RecursiveAliasCycle", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -6819,24 +6770,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + RecursiveClassWithAliasIndirection( - cls: NodeWithAliasIndirection, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + cls: NodeWithAliasIndirection, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'RecursiveClassWithAliasIndirection', + "RecursiveClassWithAliasIndirection", { - cls: cls, + "cls": cls }, undefined, this.ctx_manager.cloneContext(), @@ -6852,57 +6803,57 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + ReturnAliasWithMergedAttributes( - money: Checked, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): BamlStream, Checked> { + money: Checked, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): BamlStream, Checked> { try { const raw = this.runtime.streamFunction( - 'ReturnAliasWithMergedAttributes', + "ReturnAliasWithMergedAttributes", { - money: money, + "money": money }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) - return new BamlStream, Checked>( + return new BamlStream, Checked>( raw, - (a): a is Checked => a, - (a): a is Checked => a, + (a): a is Checked => a, + (a): a is Checked => a, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + ReturnFailingAssert( - inp: number, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + inp: number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'ReturnFailingAssert', + "ReturnFailingAssert", { - inp: inp, + "inp": inp }, undefined, this.ctx_manager.cloneContext(), @@ -6918,24 +6869,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + ReturnJsonEntry( - s: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + s: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'ReturnJsonEntry', + "ReturnJsonEntry", { - s: s, + "s": s }, undefined, this.ctx_manager.cloneContext(), @@ -6951,24 +6902,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + ReturnMalformedConstraints( - a: number, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + a: number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'ReturnMalformedConstraints', + "ReturnMalformedConstraints", { - a: a, + "a": a }, undefined, this.ctx_manager.cloneContext(), @@ -6984,24 +6935,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + SchemaDescriptions( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'SchemaDescriptions', + "SchemaDescriptions", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -7017,24 +6968,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + SimpleRecursiveListAlias( - input: RecursiveListAlias, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: RecursiveListAlias, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'SimpleRecursiveListAlias', + "SimpleRecursiveListAlias", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -7050,24 +7001,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + SimpleRecursiveMapAlias( - input: RecursiveMapAlias, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: RecursiveMapAlias, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'SimpleRecursiveMapAlias', + "SimpleRecursiveMapAlias", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -7083,24 +7034,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + StreamBigNumbers( - digits: number, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + digits: number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'StreamBigNumbers', + "StreamBigNumbers", { - digits: digits, + "digits": digits }, undefined, this.ctx_manager.cloneContext(), @@ -7116,26 +7067,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + StreamFailingAssertion( - theme: string, - length: number, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + theme: string,length: number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'StreamFailingAssertion', + "StreamFailingAssertion", { - theme: theme, - length: length, + "theme": theme,"length": length }, undefined, this.ctx_manager.cloneContext(), @@ -7151,24 +7100,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + StreamOneBigNumber( - digits: number, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + digits: number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'StreamOneBigNumber', + "StreamOneBigNumber", { - digits: digits, + "digits": digits }, undefined, this.ctx_manager.cloneContext(), @@ -7184,24 +7133,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + StreamUnionIntegers( - digits: number, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + digits: number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream<((number | null) | (string | null) | null)[], (number | string)[]> { try { const raw = this.runtime.streamFunction( - 'StreamUnionIntegers', + "StreamUnionIntegers", { - digits: digits, + "digits": digits }, undefined, this.ctx_manager.cloneContext(), @@ -7217,26 +7166,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + StreamingCompoundNumbers( - digits: number, - yapping: boolean, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + digits: number,yapping: boolean, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'StreamingCompoundNumbers', + "StreamingCompoundNumbers", { - digits: digits, - yapping: yapping, + "digits": digits,"yapping": yapping }, undefined, this.ctx_manager.cloneContext(), @@ -7252,24 +7199,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TakeRecAliasDep( - input: RecursiveAliasDependency, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: RecursiveAliasDependency, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TakeRecAliasDep', + "TakeRecAliasDep", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -7285,24 +7232,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestAnthropic( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestAnthropic', + "TestAnthropic", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -7318,24 +7265,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestAnthropicShorthand( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestAnthropicShorthand', + "TestAnthropicShorthand", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -7351,24 +7298,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestAws( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestAws', + "TestAws", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -7384,24 +7331,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestAwsInvalidAccessKey( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestAwsInvalidAccessKey', + "TestAwsInvalidAccessKey", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -7417,24 +7364,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestAwsInvalidProfile( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestAwsInvalidProfile', + "TestAwsInvalidProfile", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -7450,24 +7397,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestAwsInvalidRegion( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestAwsInvalidRegion', + "TestAwsInvalidRegion", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -7483,24 +7430,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestAwsInvalidSessionToken( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestAwsInvalidSessionToken', + "TestAwsInvalidSessionToken", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -7516,24 +7463,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestAzure( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestAzure', + "TestAzure", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -7549,24 +7496,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestAzureFailure( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestAzureFailure', + "TestAzureFailure", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -7582,24 +7529,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestAzureO1NoMaxTokens( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestAzureO1NoMaxTokens', + "TestAzureO1NoMaxTokens", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -7615,24 +7562,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestAzureO1WithMaxCompletionTokens( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestAzureO1WithMaxCompletionTokens', + "TestAzureO1WithMaxCompletionTokens", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -7648,24 +7595,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestAzureO1WithMaxTokens( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestAzureO1WithMaxTokens', + "TestAzureO1WithMaxTokens", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -7681,24 +7628,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestAzureWithMaxTokens( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestAzureWithMaxTokens', + "TestAzureWithMaxTokens", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -7714,26 +7661,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestCaching( - input: string, - not_cached: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string,not_cached: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestCaching', + "TestCaching", { - input: input, - not_cached: not_cached, + "input": input,"not_cached": not_cached }, undefined, this.ctx_manager.cloneContext(), @@ -7749,23 +7694,25 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - - TestFallbackClient(__baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): BamlStream< - string, - string - > { + + TestFallbackClient( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestFallbackClient', - {}, + "TestFallbackClient", + { + + }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -7780,24 +7727,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestFallbackToShorthand( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestFallbackToShorthand', + "TestFallbackToShorthand", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -7813,24 +7760,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestFnNamedArgsSingleBool( - myBool: boolean, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myBool: boolean, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestFnNamedArgsSingleBool', + "TestFnNamedArgsSingleBool", { - myBool: myBool, + "myBool": myBool }, undefined, this.ctx_manager.cloneContext(), @@ -7846,24 +7793,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestFnNamedArgsSingleClass( - myArg: NamedArgsSingleClass, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myArg: NamedArgsSingleClass, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestFnNamedArgsSingleClass', + "TestFnNamedArgsSingleClass", { - myArg: myArg, + "myArg": myArg }, undefined, this.ctx_manager.cloneContext(), @@ -7879,24 +7826,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestFnNamedArgsSingleEnumList( - myArg: NamedArgsSingleEnumList[], - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myArg: NamedArgsSingleEnumList[], + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestFnNamedArgsSingleEnumList', + "TestFnNamedArgsSingleEnumList", { - myArg: myArg, + "myArg": myArg }, undefined, this.ctx_manager.cloneContext(), @@ -7912,24 +7859,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestFnNamedArgsSingleFloat( - myFloat: number, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myFloat: number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestFnNamedArgsSingleFloat', + "TestFnNamedArgsSingleFloat", { - myFloat: myFloat, + "myFloat": myFloat }, undefined, this.ctx_manager.cloneContext(), @@ -7945,24 +7892,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestFnNamedArgsSingleInt( - myInt: number, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myInt: number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestFnNamedArgsSingleInt', + "TestFnNamedArgsSingleInt", { - myInt: myInt, + "myInt": myInt }, undefined, this.ctx_manager.cloneContext(), @@ -7978,129 +7925,123 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestFnNamedArgsSingleMapStringToClass( - myMap: Record, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): BamlStream, Record> { + myMap: Record, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): BamlStream<(Record ), Record> { try { const raw = this.runtime.streamFunction( - 'TestFnNamedArgsSingleMapStringToClass', + "TestFnNamedArgsSingleMapStringToClass", { - myMap: myMap, + "myMap": myMap }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) - return new BamlStream< - Record, - Record - >( + return new BamlStream<(Record ), Record>( raw, - (a): a is Record => a, + (a): a is (Record ) => a, (a): a is Record => a, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestFnNamedArgsSingleMapStringToMap( - myMap: Record>, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): BamlStream | null>, Record>> { + myMap: Record>, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): BamlStream<(Record | null)> ), Record>> { try { const raw = this.runtime.streamFunction( - 'TestFnNamedArgsSingleMapStringToMap', + "TestFnNamedArgsSingleMapStringToMap", { - myMap: myMap, + "myMap": myMap }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) - return new BamlStream< - Record | null>, - Record> - >( + return new BamlStream<(Record | null)> ), Record>>( raw, - (a): a is Record | null> => a, + (a): a is (Record | null)> ) => a, (a): a is Record> => a, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestFnNamedArgsSingleMapStringToString( - myMap: Record, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): BamlStream, Record> { + myMap: Record, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): BamlStream<(Record ), Record> { try { const raw = this.runtime.streamFunction( - 'TestFnNamedArgsSingleMapStringToString', + "TestFnNamedArgsSingleMapStringToString", { - myMap: myMap, + "myMap": myMap }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), __baml_options__?.clientRegistry, ) - return new BamlStream, Record>( + return new BamlStream<(Record ), Record>( raw, - (a): a is Record => a, + (a): a is (Record ) => a, (a): a is Record => a, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestFnNamedArgsSingleString( - myString: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myString: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestFnNamedArgsSingleString', + "TestFnNamedArgsSingleString", { - myString: myString, + "myString": myString }, undefined, this.ctx_manager.cloneContext(), @@ -8116,24 +8057,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestFnNamedArgsSingleStringArray( - myStringArray: string[], - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myStringArray: string[], + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestFnNamedArgsSingleStringArray', + "TestFnNamedArgsSingleStringArray", { - myStringArray: myStringArray, + "myStringArray": myStringArray }, undefined, this.ctx_manager.cloneContext(), @@ -8149,24 +8090,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestFnNamedArgsSingleStringList( - myArg: string[], - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myArg: string[], + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestFnNamedArgsSingleStringList', + "TestFnNamedArgsSingleStringList", { - myArg: myArg, + "myArg": myArg }, undefined, this.ctx_manager.cloneContext(), @@ -8182,24 +8123,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestGemini( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestGemini', + "TestGemini", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -8215,23 +8156,25 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - - TestGeminiOpenAiGeneric(__baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): BamlStream< - string, - string - > { + + TestGeminiOpenAiGeneric( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestGeminiOpenAiGeneric', - {}, + "TestGeminiOpenAiGeneric", + { + + }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -8246,24 +8189,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestGeminiSystem( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestGeminiSystem', + "TestGeminiSystem", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -8279,24 +8222,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestGeminiSystemAsChat( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestGeminiSystemAsChat', + "TestGeminiSystemAsChat", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -8312,24 +8255,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestImageInput( - img: Image, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + img: Image, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestImageInput', + "TestImageInput", { - img: img, + "img": img }, undefined, this.ctx_manager.cloneContext(), @@ -8345,24 +8288,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestImageInputAnthropic( - img: Image, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + img: Image, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestImageInputAnthropic', + "TestImageInputAnthropic", { - img: img, + "img": img }, undefined, this.ctx_manager.cloneContext(), @@ -8378,24 +8321,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestImageListInput( - imgs: Image[], - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + imgs: Image[], + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestImageListInput', + "TestImageListInput", { - imgs: imgs, + "imgs": imgs }, undefined, this.ctx_manager.cloneContext(), @@ -8411,24 +8354,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestMemory( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestMemory', + "TestMemory", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -8444,26 +8387,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestMulticlassNamedArgs( - myArg: NamedArgsSingleClass, - myArg2: NamedArgsSingleClass, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myArg: NamedArgsSingleClass,myArg2: NamedArgsSingleClass, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestMulticlassNamedArgs', + "TestMulticlassNamedArgs", { - myArg: myArg, - myArg2: myArg2, + "myArg": myArg,"myArg2": myArg2 }, undefined, this.ctx_manager.cloneContext(), @@ -8479,24 +8420,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestNamedArgsLiteralBool( - myBool: true, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myBool: true, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestNamedArgsLiteralBool', + "TestNamedArgsLiteralBool", { - myBool: myBool, + "myBool": myBool }, undefined, this.ctx_manager.cloneContext(), @@ -8512,24 +8453,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestNamedArgsLiteralInt( - myInt: 1, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myInt: 1, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestNamedArgsLiteralInt', + "TestNamedArgsLiteralInt", { - myInt: myInt, + "myInt": myInt }, undefined, this.ctx_manager.cloneContext(), @@ -8545,24 +8486,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestNamedArgsLiteralString( - myString: 'My String', - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myString: "My String", + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestNamedArgsLiteralString', + "TestNamedArgsLiteralString", { - myString: myString, + "myString": myString }, undefined, this.ctx_manager.cloneContext(), @@ -8578,24 +8519,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestOllama( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestOllama', + "TestOllama", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -8611,24 +8552,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestOpenAI( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestOpenAI', + "TestOpenAI", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -8644,24 +8585,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestOpenAILegacyProvider( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestOpenAILegacyProvider', + "TestOpenAILegacyProvider", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -8677,24 +8618,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestOpenAIO1NoMaxTokens( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestOpenAIO1NoMaxTokens', + "TestOpenAIO1NoMaxTokens", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -8710,24 +8651,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestOpenAIO1WithMaxCompletionTokens( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestOpenAIO1WithMaxCompletionTokens', + "TestOpenAIO1WithMaxCompletionTokens", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -8743,24 +8684,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestOpenAIO1WithMaxTokens( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestOpenAIO1WithMaxTokens', + "TestOpenAIO1WithMaxTokens", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -8776,24 +8717,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestOpenAIShorthand( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestOpenAIShorthand', + "TestOpenAIShorthand", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -8809,24 +8750,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestOpenAIWithMaxTokens( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestOpenAIWithMaxTokens', + "TestOpenAIWithMaxTokens", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -8842,24 +8783,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestOpenAIWithNullMaxTokens( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestOpenAIWithNullMaxTokens', + "TestOpenAIWithNullMaxTokens", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -8875,23 +8816,25 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - - TestRetryConstant(__baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): BamlStream< - string, - string - > { + + TestRetryConstant( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestRetryConstant', - {}, + "TestRetryConstant", + { + + }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -8906,23 +8849,25 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - - TestRetryExponential(__baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): BamlStream< - string, - string - > { + + TestRetryExponential( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestRetryExponential', - {}, + "TestRetryExponential", + { + + }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -8937,23 +8882,25 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - - TestSingleFallbackClient(__baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): BamlStream< - string, - string - > { + + TestSingleFallbackClient( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestSingleFallbackClient', - {}, + "TestSingleFallbackClient", + { + + }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -8968,24 +8915,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestUniverseQuestion( - question: UniverseQuestionInput, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + question: UniverseQuestionInput, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestUniverseQuestion', + "TestUniverseQuestion", { - question: question, + "question": question }, undefined, this.ctx_manager.cloneContext(), @@ -9001,24 +8948,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + TestVertex( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestVertex', + "TestVertex", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -9034,23 +8981,25 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - - TestVertexWithSystemInstructions(__baml_options__?: { - tb?: TypeBuilder - clientRegistry?: ClientRegistry - }): BamlStream { + + TestVertexWithSystemInstructions( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): BamlStream { try { const raw = this.runtime.streamFunction( - 'TestVertexWithSystemInstructions', - {}, + "TestVertexWithSystemInstructions", + { + + }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -9065,24 +9014,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + UnionTest_Function( - input: string | boolean, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string | boolean, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'UnionTest_Function', + "UnionTest_Function", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -9098,24 +9047,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + UseBlockConstraint( - inp: BlockConstraintForParam, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + inp: BlockConstraintForParam, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'UseBlockConstraint', + "UseBlockConstraint", { - inp: inp, + "inp": inp }, undefined, this.ctx_manager.cloneContext(), @@ -9131,24 +9080,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + UseMalformedConstraints( - a: MalformedConstraints2, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + a: MalformedConstraints2, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'UseMalformedConstraints', + "UseMalformedConstraints", { - a: a, + "a": a }, undefined, this.ctx_manager.cloneContext(), @@ -9164,24 +9113,24 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } - + UseNestedBlockConstraint( - inp: NestedBlockConstraintForParam, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + inp: NestedBlockConstraintForParam, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BamlStream { try { const raw = this.runtime.streamFunction( - 'UseNestedBlockConstraint', + "UseNestedBlockConstraint", { - inp: inp, + "inp": inp }, undefined, this.ctx_manager.cloneContext(), @@ -9197,17 +9146,15 @@ class BamlStreamClient { ) } catch (error) { if (error instanceof Error) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } } - throw error + throw error; } } + } -export const b = new BamlAsyncClient( - DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_RUNTIME, - DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_CTX, -) +export const b = new BamlAsyncClient(DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_RUNTIME, DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_CTX) \ No newline at end of file diff --git a/integ-tests/typescript/baml_client/inlinedbaml.ts b/integ-tests/typescript/baml_client/inlinedbaml.ts index 0020023b7..c5f7fffd3 100644 --- a/integ-tests/typescript/baml_client/inlinedbaml.ts +++ b/integ-tests/typescript/baml_client/inlinedbaml.ts @@ -16,7 +16,7 @@ $ pnpm add @boundaryml/baml // @ts-nocheck // biome-ignore format: autogenerated code const fileMap = { - + "clients.baml": "retry_policy Bar {\n max_retries 3\n strategy {\n type exponential_backoff\n }\n}\n\nretry_policy Foo {\n max_retries 3\n strategy {\n type constant_delay\n delay_ms 100\n }\n}\n\nclient GPT4 {\n provider openai\n options {\n model gpt-4o\n api_key env.OPENAI_API_KEY\n }\n}\n\n\nclient GPT4o {\n provider openai\n options {\n model gpt-4o\n api_key env.OPENAI_API_KEY\n }\n}\n\n\nclient GPT4Turbo {\n retry_policy Bar\n provider openai\n options {\n model gpt-4-turbo\n api_key env.OPENAI_API_KEY\n }\n}\n\nretry_policy GPT4oRetry {\n max_retries 2\n strategy {\n type exponential_backoff\n }\n}\n\nclient GPT35 {\n provider openai\n retry_policy GPT4oRetry\n options {\n model \"gpt-4o-mini\"\n api_key env.OPENAI_API_KEY\n }\n}\n\nclient GPT35LegacyProvider {\n provider openai\n options {\n model \"gpt-3.5-turbo\"\n api_key env.OPENAI_API_KEY\n }\n}\n\n\nclient Ollama {\n provider ollama\n options {\n model llama2\n }\n}\n\nclient GPT35Azure {\n provider azure-openai\n options {\n resource_name \"west-us-azure-baml\"\n deployment_id \"gpt-35-turbo-default\"\n // base_url \"https://west-us-azure-baml.openai.azure.com/openai/deployments/gpt-35-turbo-default\"\n api_version \"2024-02-01\"\n api_key env.AZURE_OPENAI_API_KEY\n }\n}\n\n// Azure O1 client without max_tokens (should not add default)\nclient AzureO1 {\n provider azure-openai\n options {\n resource_name \"west-us-azure-baml\"\n deployment_id \"o1-mini\"\n api_version \"2024-08-01-preview\"\n api_key env.AZURE_OPENAI_API_KEY\n max_tokens null\n }\n}\n\n// Azure O1 client with explicit max_tokens (should keep user value)\nclient AzureO1WithMaxTokens {\n provider azure-openai\n options {\n resource_name \"west-us-azure-baml\"\n deployment_id \"o1-mini\"\n api_version \"2024-08-01-preview\"\n api_key env.AZURE_OPENAI_API_KEY\n max_tokens 1000\n }\n}\n\nclient AzureO1WithMaxCompletionTokens {\n provider azure-openai\n options {\n resource_name \"west-us-azure-baml\"\n deployment_id \"o1-mini\"\n api_version \"2024-08-01-preview\"\n api_key env.AZURE_OPENAI_API_KEY\n max_completion_tokens 1000\n }\n}\n\n// Azure GPT-35 client with explicit max_tokens (should keep user value)\nclient GPT35AzureWithMaxTokens {\n provider azure-openai\n options {\n resource_name \"west-us-azure-baml\"\n deployment_id \"gpt-35-turbo-default\"\n api_version \"2024-02-01\"\n api_key env.AZURE_OPENAI_API_KEY\n max_tokens 1000\n }\n}\n\n// Azure client with invalid resource name (for testing failures)\nclient GPT35AzureFailed {\n provider azure-openai\n options {\n resource_name \"west-us-azure-baml-incorrect-suffix\"\n deployment_id \"gpt-35-turbo-default\"\n api_key env.AZURE_OPENAI_API_KEY\n }\n}\n\nclient Gemini {\n provider google-ai\n options {\n model gemini-1.5-pro-001\n api_key env.GOOGLE_API_KEY\n safetySettings {\n category HARM_CATEGORY_HATE_SPEECH\n threshold BLOCK_LOW_AND_ABOVE\n }\n }\n}\n\nclient GeminiOpenAiGeneric {\n provider \"openai-generic\"\n options {\n base_url \"https://generativelanguage.googleapis.com/v1beta/\"\n model \"gemini-1.5-flash\"\n api_key env.GOOGLE_API_KEY\n }\n}\n\nclient Vertex {\n provider vertex-ai\n options {\n model gemini-1.5-pro\n location us-central1\n credentials env.INTEG_TESTS_GOOGLE_APPLICATION_CREDENTIALS_CONTENT\n }\n}\n\n\nclient AwsBedrock {\n provider aws-bedrock\n options {\n inference_configuration {\n max_tokens 100\n }\n // model \"anthropic.claude-3-5-sonnet-20240620-v1:0\"\n // model_id \"anthropic.claude-3-haiku-20240307-v1:0\"\n model \"meta.llama3-8b-instruct-v1:0\"\n // region \"us-east-1\"\n // access_key_id env.AWS_ACCESS_KEY_ID\n // secret_access_key env.AWS_SECRET_ACCESS_KEY\n // session_token env.AWS_SESSION_TOKEN\n // session_token null\n // model_id \"mistral.mistral-7b-instruct-v0:2\"\n }\n}\n\nclient AwsBedrockInvalidRegion {\n provider aws-bedrock\n options {\n region \"us-invalid-7\"\n inference_configuration {\n max_tokens 100\n }\n // model \"anthropic.claude-3-5-sonnet-20240620-v1:0\"\n // model_id \"anthropic.claude-3-haiku-20240307-v1:0\"\n model_id \"meta.llama3-8b-instruct-v1:0\"\n // model_id \"mistral.mistral-7b-instruct-v0:2\"\n }\n}\n\nclient AwsBedrockInvalidAccessKey {\n provider aws-bedrock\n options {\n model_id \"meta.llama3-8b-instruct-v1:0\"\n access_key_id \"AKIAINVALID12345678\"\n secret_access_key \"abcdef1234567890abcdef1234567890abcdef12\"\n inference_configuration {\n max_tokens 100\n }\n }\n}\n\nclient AwsBedrockInvalidProfile {\n provider aws-bedrock\n options {\n model_id \"meta.llama3-8b-instruct-v1:0\"\n profile \"invalid-profile\"\n inference_configuration {\n max_tokens 100\n }\n }\n}\n\nclient AwsBedrockInvalidSessionToken {\n provider aws-bedrock\n options {\n model_id \"meta.llama3-8b-instruct-v1:0\"\n region \"us-east-1\"\n access_key_id \"AKIAINVALID12345678\"\n secret_access_key \"abcdef1234567890abcdef1234567890abcdef12\"\n session_token \"invalid-session-token\"\n inference_configuration {\n max_tokens 100\n }\n }\n}\n\n\nclient Invalid{\n provider aws-bedrock\n options {\n model_id \"meta.llama3-8b-instruct-v1:0\"\n region \"us-east-1\"\n access_key_id \"AKIAINVALID12345678\"\n secret_access_key \"abcdef1234567890abcdef1234567890abcdef12\"\n session_token \"invalid-session-token\"\n inference_configuration {\n max_tokens 100\n }\n }\n}\n\nclient Sonnet {\n provider anthropic\n options {\n model claude-3-5-sonnet-20241022\n api_key env.ANTHROPIC_API_KEY\n }\n}\n\nclient Claude {\n provider anthropic\n options {\n model claude-3-haiku-20240307\n api_key env.ANTHROPIC_API_KEY\n max_tokens 1000\n }\n}\n\nclient ClaudeWithCaching {\n provider anthropic\n options {\n model claude-3-haiku-20240307\n api_key env.ANTHROPIC_API_KEY\n max_tokens 500\n allowed_role_metadata [\"cache_control\"]\n headers {\n \"anthropic-beta\" \"prompt-caching-2024-07-31\"\n }\n }\n}\n\nclient Resilient_SimpleSyntax {\n retry_policy Foo\n provider baml-fallback\n options {\n strategy [\n GPT4Turbo\n GPT35\n Lottery_SimpleSyntax\n ]\n }\n}\n\nclient Lottery_SimpleSyntax {\n provider baml-round-robin\n options {\n start 0\n strategy [\n GPT35\n Claude\n ]\n }\n}\n\nclient TogetherAi {\n provider \"openai-generic\"\n options {\n base_url \"https://api.together.ai/v1\"\n api_key env.TOGETHER_API_KEY\n model \"meta-llama/Llama-3-70b-chat-hf\"\n }\n}\n\n// OpenAI O1 client without max_tokens (should not add default)\nclient OpenAIO1 {\n provider openai\n options {\n model \"o1-mini\"\n api_key env.OPENAI_API_KEY\n }\n}\n\n// OpenAI O1 client with explicit max_tokens (should fail)\nclient OpenAIO1WithMaxTokens {\n provider openai\n options {\n model \"o1-mini\"\n api_key env.OPENAI_API_KEY\n max_tokens 1000\n }\n}\n\n// OpenAI O1 client with explicit max_completion_tokens\nclient OpenAIO1WithMaxCompletionTokens {\n provider openai\n options {\n model \"o1-mini\"\n api_key env.OPENAI_API_KEY\n max_completion_tokens 1000\n }\n}\n\n// OpenAI GPT-4 client with explicit max_tokens\nclient GPT4WithMaxTokens {\n provider openai\n options {\n model \"gpt-4\"\n api_key env.OPENAI_API_KEY\n max_tokens 1000\n }\n}\n", "custom-task.baml": "class BookOrder {\n orderId string @description(#\"\n The ID of the book order\n \"#)\n title string @description(#\"\n The title of the ordered book\n \"#)\n quantity int @description(#\"\n The quantity of books ordered\n \"#)\n price float @description(#\"\n The price of the book\n \"#)\n}\n\nclass FlightConfirmation {\n confirmationNumber string @description(#\"\n The flight confirmation number\n \"#)\n flightNumber string @description(#\"\n The flight number\n \"#)\n departureTime string @description(#\"\n The scheduled departure time of the flight\n \"#)\n arrivalTime string @description(#\"\n The scheduled arrival time of the flight\n \"#)\n seatNumber string @description(#\"\n The seat number assigned on the flight\n \"#)\n}\n\nclass GroceryReceipt {\n receiptId string @description(#\"\n The ID of the grocery receipt\n \"#)\n storeName string @description(#\"\n The name of the grocery store\n \"#)\n items (string | int | float)[] @description(#\"\n A list of items purchased. Each item consists of a name, quantity, and price.\n \"#)\n totalAmount float @description(#\"\n The total amount spent on groceries\n \"#)\n}\n\nclass CustomTaskResult {\n bookOrder BookOrder | null\n flightConfirmation FlightConfirmation | null\n groceryReceipt GroceryReceipt | null\n}\n\nfunction CustomTask(input: string) -> BookOrder | FlightConfirmation | GroceryReceipt {\n client \"openai/gpt-4o-mini\"\n prompt #\"\n Given the input string, extract either an order for a book, a flight confirmation, or a grocery receipt.\n\n {{ ctx.output_format }}\n\n Input:\n \n {{ input}}\n \"#\n}\n\ntest CustomTask {\n functions [CustomTask]\n args {\n input #\"\nDear [Your Name],\n\nThank you for booking with [Airline Name]! We are pleased to confirm your upcoming flight.\n\nFlight Confirmation Details:\n\nBooking Reference: ABC123\nPassenger Name: [Your Name]\nFlight Number: XY789\nDeparture Date: September 15, 2024\nDeparture Time: 10:30 AM\nArrival Time: 1:45 PM\nDeparture Airport: John F. Kennedy International Airport (JFK), New York, NY\nArrival Airport: Los Angeles International Airport (LAX), Los Angeles, CA\nSeat Number: 12A\nClass: Economy\nBaggage Allowance:\n\nChecked Baggage: 1 piece, up to 23 kg\nCarry-On Baggage: 1 piece, up to 7 kg\nImportant Information:\n\nPlease arrive at the airport at least 2 hours before your scheduled departure.\nCheck-in online via our website or mobile app to save time at the airport.\nEnsure that your identification documents are up to date and match the name on your booking.\nContact Us:\n\nIf you have any questions or need to make changes to your booking, please contact our customer service team at 1-800-123-4567 or email us at support@[airline].com.\n\nWe wish you a pleasant journey and thank you for choosing [Airline Name].\n\nBest regards,\n\n[Airline Name] Customer Service\n \"#\n }\n}", "fiddle-examples/chain-of-thought.baml": "class Email {\n subject string\n body string\n from_address string\n}\n\nenum OrderStatus {\n ORDERED\n SHIPPED\n DELIVERED\n CANCELLED\n}\n\nclass OrderInfo {\n order_status OrderStatus\n tracking_number string?\n estimated_arrival_date string?\n}\n\nfunction GetOrderInfo(email: Email) -> OrderInfo {\n client GPT4\n prompt #\"\n Given the email below:\n\n ```\n from: {{email.from_address}}\n Email Subject: {{email.subject}}\n Email Body: {{email.body}}\n ```\n\n Extract this info from the email in JSON format:\n {{ ctx.output_format }}\n\n Before you output the JSON, please explain your\n reasoning step-by-step. Here is an example on how to do this:\n 'If we think step by step we can see that ...\n therefore the output JSON is:\n {\n ... the json schema ...\n }'\n \"#\n}", @@ -112,5 +112,5 @@ const fileMap = { "test-files/testing_pipeline/resume.baml": "class Resume {\n name string\n email string\n phone string\n experience Education[]\n education string[]\n skills string[]\n}\n\nclass Education {\n institution string\n location string\n degree string\n major string[]\n graduation_date string?\n}\n\ntemplate_string AddRole(foo: string) #\"\n {{ _.role('system')}}\n You are a {{ foo }}. be nice\n\n {{ _.role('user') }}\n\"#\n\nclient TestClient {\n provider fallback\n retry_policy Constant\n options {\n strategy [\n Claude\n GPT35\n AwsBedrock\n ]\n }\n}\n\nclient Claude2 {\n provider anthropic\n options {\n model claude-3-haiku-20240307\n api_key env.FOOBAR3\n max_tokens 1000\n }\n}\n\nfunction ExtractResume(resume: string, img: image?) -> Resume {\n client Claude2\n prompt #\"\n {{ AddRole(\"Software Engineer\") }}\n\n Extract data:\n \n\n <<<<\n {{ resume }}\n <<<<\n\n {% if img %}\n {{img}}\n {% endif %}\n\n {{ ctx.output_format }}\n \"#\n}\n\ntest sam_resume {\n functions [ExtractResume]\n args {\n img {\n url \"https://avatars.githubusercontent.com/u/1016595?v=4\"\n }\n resume #\"\n Sam Lijin\n he/him | jobs@sxlijin.com | sxlijin.github.io | 111-222-3333 | sxlijin | sxlijin\n\n Experience\n Trunk\n | July 2021 - current\n Trunk Check | Senior Software Engineer | Services TL, Mar 2023 - current | IC, July 2021 - Feb 2023\n Proposed, designed, and led a team of 3 to build a web experience for Check (both a web-only onboarding flow and SaaS offerings)\n Proposed and built vulnerability scanning into Check, enabling it to compete with security products such as Snyk\n Helped grow Check from <1K users to 90K+ users by focusing on product-led growth\n Google | Sept 2017 - June 2021\n User Identity SRE | Senior Software Engineer | IC, Mar 2021 - June 2021\n Designed an incremental key rotation system to limit the global outage risk to Google SSO\n Discovered and severed an undocumented Gmail serving dependency on Identity-internal systems\n Cloud Firestore | Senior Software Engineer | EngProd TL, Aug 2019 - Feb 2021 | IC, Sept 2017 - July 2019\n Metadata TTL system: backlog of XX trillion records, sustained 1M ops/sec, peaking at 3M ops/sec\n\n Designed and implemented a logging system with novel observability and privacy requirements\n Designed and implemented Jepsen-style testing to validate correctness guarantees\n Datastore Migration: zero downtime, xM RPS and xxPB of data over xM customers and 36 datacenters\n\n Designed composite index migration, queue processing migration, progressive rollout, fast rollback, and disk stockout mitigations; implemented transaction log replay, state transitions, and dark launch process\n Designed and implemented end-to-end correctness and performance testing\n Velocity improvements for 60-eng org\n\n Proposed and implemented automated rollbacks: got us out of a 3-month release freeze and prevented 5 outages over the next 6 months\n Proposed and implemented new development and release environments spanning 30+ microservices\n Incident response for API proxy rollback affecting every Google Cloud service\n\n Google App Engine Memcache | Software Engineer | EngProd TL, Apr 2019 - July 2019\n Proposed and led execution of test coverage improvement strategy for a new control plane: reduced rollbacks and ensured strong consistency of a distributed cache serving xxM QPS\n Designed and implemented automated performance regression testing for two critical serving paths\n Used to validate Google-wide rollout of AMD CPUs, by proving a 50p latency delta of <10µs\n Implemented on shared Borg (i.e. vulnerable to noisy neighbors) with <12% variance\n Miscellaneous | Sept 2017 - June 2021\n Redesigned the Noogler training on Google-internal storage technologies & trained 2500+ Nooglers\n Landed multiple google3-wide refactorings, each spanning xxK files (e.g. SWIG to CLIF)\n Education\n Vanderbilt University (Nashville, TN) | May 2017 | B.S. in Computer Science, Mathematics, and Political Science\n\n Stuyvesant HS (New York, NY) | 2013\n\n Skills\n C++, Java, Typescript, Javascript, Python, Bash; light experience with Rust, Golang, Scheme\n gRPC, Bazel, React, Linux\n Hobbies: climbing, skiing, photography\n \"#\n }\n}\n\ntest vaibhav_resume {\n functions [ExtractResume]\n args {\n resume #\"\n Vaibhav Gupta\n linkedin/vaigup\n (972) 400-5279\n vaibhavtheory@gmail.com\n EXPERIENCE\n Google,\n Software Engineer\n Dec 2018-Present\n Seattle, WA\n •\n Augmented Reality,\n Depth Team\n •\n Technical Lead for on-device optimizations\n •\n Optimized and designed front\n facing depth algorithm\n on Pixel 4\n •\n Focus: C++ and SIMD on custom silicon\n \n \n EDUCATION\n University of Texas at Austin\n Aug 2012-May 2015\n Bachelors of Engineering, Integrated Circuits\n Bachelors of Computer Science\n \"#\n }\n}", } export const getBamlFiles = () => { - return fileMap -} + return fileMap; +} \ No newline at end of file diff --git a/integ-tests/typescript/baml_client/partial_types.ts b/integ-tests/typescript/baml_client/partial_types.ts index c02510f94..6007f625f 100644 --- a/integ-tests/typescript/baml_client/partial_types.ts +++ b/integ-tests/typescript/baml_client/partial_types.ts @@ -15,645 +15,524 @@ $ pnpm add @boundaryml/baml // tslint:disable // @ts-nocheck // biome-ignore format: autogenerated code -import type { Audio, Image } from "@boundaryml/baml" -import type { Check, Checked } from './types' -import type { - AliasedEnum, - AnotherObject, - BigNumbers, - BinaryNode, - Blah, - BlockConstraint, - BlockConstraintForParam, - BookOrder, - Category, - Category2, - Category3, - ClassForNullLiteral, - ClassOptionalOutput, - ClassOptionalOutput2, - ClassToRecAlias, - ClassWithBlockDone, - ClassWithImage, - ClassWithoutDone, - Color, - ComplexMemoryObject, - CompoundBigNumbers, - ContactInfo, - CustomTaskResult, - DataType, - DummyOutput, - DynEnumOne, - DynEnumTwo, - DynInputOutput, - DynamicClassOne, - DynamicClassTwo, - DynamicOutput, - Earthling, - Education, - Email, - EmailAddress, - EnumInClass, - EnumOutput, - Event, - FakeImage, - FlightConfirmation, - FooAny, - Forest, - FormatterTest0, - FormatterTest1, - FormatterTest2, - FormatterTest3, - GroceryReceipt, - Hobby, - InnerClass, - InnerClass2, - InputClass, - InputClassNested, - JsonArray, - JsonObject, - JsonValue, - LinkedList, - LinkedListAliasNode, - LiteralClassHello, - LiteralClassOne, - LiteralClassTwo, - MalformedConstraints, - MalformedConstraints2, - MapKey, - Martian, - MemoryObject, - MergeAttrs, - NamedArgsSingleClass, - NamedArgsSingleEnum, - NamedArgsSingleEnumList, - Nested, - Nested2, - NestedBlockConstraint, - NestedBlockConstraintForParam, - Node, - NodeWithAliasIndirection, - OptionalListAndMap, - OptionalTest_CategoryType, - OptionalTest_Prop1, - OptionalTest_ReturnType, - OrderInfo, - OrderStatus, - OriginalA, - OriginalB, - Person, - PhoneNumber, - Quantity, - RaysData, - RecAliasOne, - RecAliasThree, - RecAliasTwo, - ReceiptInfo, - ReceiptItem, - Recipe, - RecursiveAliasDependency, - RecursiveListAlias, - RecursiveMapAlias, - Resume, - Schema, - SearchParams, - SemanticContainer, - SmallThing, - SomeClassNestedDynamic, - StringToClassEntry, - Tag, - TestClassAlias, - TestClassNested, - TestClassWithEnum, - TestEnum, - TestMemoryOutput, - TestOutputClass, - Tree, - TwoStoriesOneTitle, - UnionTest_ReturnType, - UniverseQuestion, - UniverseQuestionInput, - WithReasoning, -} from './types' -import type * as types from './types' +import type { Image, Audio } from "@boundaryml/baml" +import type { Checked, Check } from "./types" +import type { AliasedEnum, AnotherObject, BigNumbers, BinaryNode, Blah, BlockConstraint, BlockConstraintForParam, BookOrder, Category, Category2, Category3, ClassForNullLiteral, ClassOptionalOutput, ClassOptionalOutput2, ClassToRecAlias, ClassWithBlockDone, ClassWithImage, ClassWithoutDone, Color, ComplexMemoryObject, CompoundBigNumbers, ContactInfo, CustomTaskResult, DataType, DummyOutput, DynEnumOne, DynEnumTwo, DynInputOutput, DynamicClassOne, DynamicClassTwo, DynamicOutput, Earthling, Education, Email, EmailAddress, EnumInClass, EnumOutput, Event, FakeImage, FlightConfirmation, FooAny, Forest, FormatterTest0, FormatterTest1, FormatterTest2, FormatterTest3, GroceryReceipt, Hobby, InnerClass, InnerClass2, InputClass, InputClassNested, JsonArray, JsonEntry, JsonObject, JsonTemplate, JsonValue, LinkedList, LinkedListAliasNode, LiteralClassHello, LiteralClassOne, LiteralClassTwo, MalformedConstraints, MalformedConstraints2, MapKey, Martian, MemoryObject, MergeAttrs, NamedArgsSingleClass, NamedArgsSingleEnum, NamedArgsSingleEnumList, Nested, Nested2, NestedBlockConstraint, NestedBlockConstraintForParam, Node, NodeWithAliasIndirection, OptionalListAndMap, OptionalTest_CategoryType, OptionalTest_Prop1, OptionalTest_ReturnType, OrderInfo, OrderStatus, OriginalA, OriginalB, Person, PhoneNumber, Quantity, RaysData, RecAliasOne, RecAliasThree, RecAliasTwo, ReceiptInfo, ReceiptItem, Recipe, RecursiveAliasDependency, RecursiveListAlias, RecursiveMapAlias, Resume, Schema, SearchParams, SemanticContainer, SimpleTag, SmallThing, SomeClassNestedDynamic, StringToClassEntry, Tag, TestClassAlias, TestClassNested, TestClassWithEnum, TestEnum, TestMemoryOutput, TestOutputClass, Tree, TwoStoriesOneTitle, UnionTest_ReturnType, UniverseQuestion, UniverseQuestionInput, WithReasoning } from "./types" +import type * as types from "./types" /****************************************************************************** - * - * These types are used for streaming, for when an instance of a type - * is still being built up and any of its fields is not yet fully available. - * - ******************************************************************************/ +* +* These types are used for streaming, for when an instance of a type +* is still being built up and any of its fields is not yet fully available. +* +******************************************************************************/ export interface StreamState { - value: T - state: 'Pending' | 'Incomplete' | 'Complete' + value: T + state: "Pending" | "Incomplete" | "Complete" } export namespace partial_types { - export interface AnotherObject { - id?: string | null - thingy2?: string | null - thingy3?: string | null - } - - export interface BigNumbers { - a?: number | null - b?: number | null - } - - export interface BinaryNode { - data?: number | null - left: (partial_types.BinaryNode | null) | null - right: (partial_types.BinaryNode | null) | null - } - - export interface Blah { - prop4: (string | null) | null - } - - export interface BlockConstraint { - foo?: number | null - bar?: string | null - } - - export interface BlockConstraintForParam { - bcfp?: number | null - bcfp2?: string | null - } - - export interface BookOrder { - orderId?: string | null - title?: string | null - quantity?: number | null - price?: number | null - } - - export interface ClassForNullLiteral { - a: 'hi' - } - - export interface ClassOptionalOutput { - prop1?: string | null - prop2?: string | null - } - - export interface ClassOptionalOutput2 { - prop1: (string | null) | null - prop2: (string | null) | null - prop3: (partial_types.Blah | null) | null - } - - export interface ClassToRecAlias { - list?: partial_types.LinkedListAliasNode | null - } - - export interface ClassWithBlockDone { - i_16_digits?: number | null - s_20_words?: string | null - } - - export interface ClassWithImage { - myImage?: Image | null - param2?: string | null - fake_image?: partial_types.FakeImage | null - } - - export interface ClassWithoutDone { - i_16_digits?: number | null - s_20_words?: StreamState - } - - export interface ComplexMemoryObject { - id?: string | null - name?: string | null - description?: string | null - metadata?: ((string | null) | (number | null) | (number | null) | null)[] - } - - export interface CompoundBigNumbers { - big?: partial_types.BigNumbers | null - big_nums?: (partial_types.BigNumbers | null)[] - another?: partial_types.BigNumbers | null - } - - export interface ContactInfo { - primary?: (partial_types.PhoneNumber | null) | (partial_types.EmailAddress | null) | null - secondary?: (partial_types.PhoneNumber | null) | (partial_types.EmailAddress | null) | (null | null) | null - } - - export interface CustomTaskResult { - bookOrder?: (partial_types.BookOrder | null) | ((null | null) | null) | null - flightConfirmation?: (partial_types.FlightConfirmation | null) | ((null | null) | null) | null - groceryReceipt?: (partial_types.GroceryReceipt | null) | ((null | null) | null) | null - } - - export interface DummyOutput { - nonce?: string | null - nonce2?: string | null - [key: string]: any - } - - export interface DynInputOutput { - testKey?: string | null - [key: string]: any - } - - export interface DynamicClassOne { - [key: string]: any - } - - export interface DynamicClassTwo { - hi?: string | null - some_class?: partial_types.SomeClassNestedDynamic | null - status?: string | DynEnumOne | null - [key: string]: any - } - - export interface DynamicOutput { - [key: string]: any - } - - export interface Earthling { - age?: Checked - } - - export interface Education { - institution?: string | null - location?: string | null - degree?: string | null - major?: (string | null)[] - graduation_date: (string | null) | null - } - - export interface Email { - subject?: string | null - body?: string | null - from_address?: string | null - } - - export interface EmailAddress { - value?: string | null - } - - export interface Event { - title?: string | null - date?: string | null - location?: string | null - description?: string | null - } - - export interface FakeImage { - url?: string | null - } - - export interface FlightConfirmation { - confirmationNumber?: string | null - flightNumber?: string | null - departureTime?: string | null - arrivalTime?: string | null - seatNumber?: string | null - } - - export interface FooAny { - planetary_age?: (partial_types.Martian | null) | (partial_types.Earthling | null) | null - certainty?: Checked - species?: Checked - } - - export interface Forest { - trees?: (partial_types.Tree | null)[] - } - - export interface FormatterTest0 { - lorem?: string | null - ipsum?: string | null - } - - export interface FormatterTest1 { - lorem?: string | null - ipsum?: string | null - } - - export interface FormatterTest2 { - lorem?: string | null - ipsum?: string | null - } - - export interface FormatterTest3 { - lorem?: string | null - ipsum?: string | null - } - - export interface GroceryReceipt { - receiptId?: string | null - storeName?: string | null - items?: ((string | null) | (number | null) | (number | null) | null)[] - totalAmount?: number | null - } - - export interface InnerClass { - prop1?: string | null - prop2?: string | null - inner?: partial_types.InnerClass2 | null - } - - export interface InnerClass2 { - prop2?: number | null - prop3?: number | null - } - - export interface InputClass { - key?: string | null - key2?: string | null - } - - export interface InputClassNested { - key?: string | null - nested?: partial_types.InputClass | null - } - - export interface LinkedList { - head: (partial_types.Node | null) | null - len?: number | null - } - - export interface LinkedListAliasNode { - value?: number | null - next: (partial_types.LinkedListAliasNode | null) | null - } - - export interface LiteralClassHello { - prop: 'hello' - } - - export interface LiteralClassOne { - prop: 'one' - } - - export interface LiteralClassTwo { - prop: 'two' - } - - export interface MalformedConstraints { - foo?: Checked - } - - export interface MalformedConstraints2 { - foo?: number | null - } - - /** - * A Martian organism with an age. - * Such a nice type. - */ - export interface Martian { + + export interface AnotherObject { + id?: (string | null) + thingy2?: (string | null) + thingy3?: (string | null) + } + + export interface BigNumbers { + a?: (number | null) + b?: (number | null) + } + + export interface BinaryNode { + data?: (number | null) + left: ((partial_types.BinaryNode | null) | null) + right: ((partial_types.BinaryNode | null) | null) + } + + export interface Blah { + prop4: ((string | null) | null) + } + + export interface BlockConstraint { + foo?: (number | null) + bar?: (string | null) + } + + export interface BlockConstraintForParam { + bcfp?: (number | null) + bcfp2?: (string | null) + } + + export interface BookOrder { + orderId?: (string | null) + title?: (string | null) + quantity?: (number | null) + price?: (number | null) + } + + export interface ClassForNullLiteral { + a: "hi" + } + + export interface ClassOptionalOutput { + prop1?: (string | null) + prop2?: (string | null) + } + + export interface ClassOptionalOutput2 { + prop1: ((string | null) | null) + prop2: ((string | null) | null) + prop3: ((partial_types.Blah | null) | null) + } + + export interface ClassToRecAlias { + list?: (partial_types.LinkedListAliasNode | null) + } + + export interface ClassWithBlockDone { + i_16_digits?: (number | null) + s_20_words?: (string | null) + } + + export interface ClassWithImage { + myImage?: (Image | null) + param2?: (string | null) + fake_image?: (partial_types.FakeImage | null) + } + + export interface ClassWithoutDone { + i_16_digits?: (number | null) + s_20_words?: StreamState<(string | null)> + } + + export interface ComplexMemoryObject { + id?: (string | null) + name?: (string | null) + description?: (string | null) + metadata?: ((string | null) | (number | null) | (number | null) | null)[] + } + + export interface CompoundBigNumbers { + big?: (partial_types.BigNumbers | null) + big_nums?: (partial_types.BigNumbers | null)[] + another?: (partial_types.BigNumbers | null) + } + + export interface ContactInfo { + primary?: ((partial_types.PhoneNumber | null) | (partial_types.EmailAddress | null) | null) + secondary?: ((partial_types.PhoneNumber | null) | (partial_types.EmailAddress | null) | (null | null) | null) + } + + export interface CustomTaskResult { + bookOrder?: ((partial_types.BookOrder | null) | ((null | null) | null) | null) + flightConfirmation?: ((partial_types.FlightConfirmation | null) | ((null | null) | null) | null) + groceryReceipt?: ((partial_types.GroceryReceipt | null) | ((null | null) | null) | null) + } + + export interface DummyOutput { + nonce?: (string | null) + nonce2?: (string | null) + [key: string]: any; + } + + export interface DynInputOutput { + testKey?: (string | null) + [key: string]: any; + } + + export interface DynamicClassOne { + [key: string]: any; + } + + export interface DynamicClassTwo { + hi?: (string | null) + some_class?: (partial_types.SomeClassNestedDynamic | null) + status?: (string | DynEnumOne | null) + [key: string]: any; + } + + export interface DynamicOutput { + [key: string]: any; + } + + export interface Earthling { + age?: Checked<(number | null),"earth_aged" | "no_infants"> + } + + export interface Education { + institution?: (string | null) + location?: (string | null) + degree?: (string | null) + major?: (string | null)[] + graduation_date: ((string | null) | null) + } + + export interface Email { + subject?: (string | null) + body?: (string | null) + from_address?: (string | null) + } + + export interface EmailAddress { + value?: (string | null) + } + + export interface Event { + title?: (string | null) + date?: (string | null) + location?: (string | null) + description?: (string | null) + } + + export interface FakeImage { + url?: (string | null) + } + + export interface FlightConfirmation { + confirmationNumber?: (string | null) + flightNumber?: (string | null) + departureTime?: (string | null) + arrivalTime?: (string | null) + seatNumber?: (string | null) + } + + export interface FooAny { + planetary_age?: ((partial_types.Martian | null) | (partial_types.Earthling | null) | null) + certainty?: Checked<(number | null),"unreasonably_certain"> + species?: Checked<(string | null),"regex_bad" | "regex_good" | "trivial"> + } + + export interface Forest { + trees?: (partial_types.Tree | null)[] + } + + export interface FormatterTest0 { + lorem?: (string | null) + ipsum?: (string | null) + } + + export interface FormatterTest1 { + lorem?: (string | null) + ipsum?: (string | null) + } + + export interface FormatterTest2 { + lorem?: (string | null) + ipsum?: (string | null) + } + + export interface FormatterTest3 { + lorem?: (string | null) + ipsum?: (string | null) + } + + export interface GroceryReceipt { + receiptId?: (string | null) + storeName?: (string | null) + items?: ((string | null) | (number | null) | (number | null) | null)[] + totalAmount?: (number | null) + } + + export interface InnerClass { + prop1?: (string | null) + prop2?: (string | null) + inner?: (partial_types.InnerClass2 | null) + } + + export interface InnerClass2 { + prop2?: (number | null) + prop3?: (number | null) + } + + export interface InputClass { + key?: (string | null) + key2?: (string | null) + } + + export interface InputClassNested { + key?: (string | null) + nested?: (partial_types.InputClass | null) + } + + export interface LinkedList { + head: ((partial_types.Node | null) | null) + len?: (number | null) + } + + export interface LinkedListAliasNode { + value?: (number | null) + next: ((partial_types.LinkedListAliasNode | null) | null) + } + + export interface LiteralClassHello { + prop: "hello" + } + + export interface LiteralClassOne { + prop: "one" + } + + export interface LiteralClassTwo { + prop: "two" + } + + export interface MalformedConstraints { + foo?: Checked<(number | null),"foo_check"> + } + + export interface MalformedConstraints2 { + foo?: (number | null) + } + /** - * The age of the Martian in Mars years. - * So many Mars years. - */ - age?: Checked - } - - export interface MemoryObject { - id?: string | null - name?: string | null - description?: string | null - } - - export interface MergeAttrs { - amount?: Checked - } - - export interface NamedArgsSingleClass { - key?: string | null - key_two?: boolean | null - key_three?: number | null - } - - export interface Nested { - prop3?: (string | null) | ((null | null) | null) | null - prop4?: (string | null) | ((null | null) | null) | null - prop20?: partial_types.Nested2 | null - } - - export interface Nested2 { - prop11?: (string | null) | ((null | null) | null) | null - prop12?: (string | null) | ((null | null) | null) | null - } - - export interface NestedBlockConstraint { - nbc?: Checked - } - - export interface NestedBlockConstraintForParam { - nbcfp?: partial_types.BlockConstraintForParam | null - } - - export interface Node { - data?: number | null - next: (partial_types.Node | null) | null - } - - export interface NodeWithAliasIndirection { - value?: number | null - next: (partial_types.NodeWithAliasIndirection | null) | null - } - - export interface OptionalListAndMap { - p: (string | null)[] | null - q: (Record | null) | null - } - - export interface OptionalTest_Prop1 { - omega_a?: string | null - omega_b?: number | null - } - - export interface OptionalTest_ReturnType { - omega_1: (partial_types.OptionalTest_Prop1 | null) | null - omega_2: (string | null) | null - omega_3?: ((OptionalTest_CategoryType | null) | null)[] - } - - export interface OrderInfo { - order_status?: OrderStatus | null - tracking_number: (string | null) | null - estimated_arrival_date: (string | null) | null - } - - export interface OriginalA { - value?: number | null - } - - export interface OriginalB { - value?: number | null - [key: string]: any - } - - export interface Person { - name: (string | null) | null - hair_color: (string | Color | null) | null - [key: string]: any - } - - export interface PhoneNumber { - value?: string | null - } - - export interface Quantity { - amount?: (number | null) | (number | null) | null - unit: (string | null) | null - } - - export interface RaysData { - dataType?: DataType | null - value?: (partial_types.Resume | null) | (partial_types.Event | null) | null - } - - export interface ReceiptInfo { - items?: (partial_types.ReceiptItem | null)[] - total_cost: (number | null) | null - venue?: 'barisa' | 'ox_burger' | null - } - - export interface ReceiptItem { - name?: string | null - description: (string | null) | null - quantity?: number | null - price?: number | null - } - - export interface Recipe { - ingredients?: Record | null - recipe_type?: 'breakfast' | 'dinner' | null - } - - export interface RecursiveAliasDependency { - value?: JsonValue - } - - export interface Resume { - name?: string | null - email?: string | null - phone?: string | null - experience?: (partial_types.Education | null)[] - education?: (string | null)[] - skills?: (string | null)[] - } - - export interface Schema { - prop1?: (string | null) | ((null | null) | null) | null - prop2?: (partial_types.Nested | null) | (string | null) | null - prop5?: ((string | null) | ((null | null) | null) | null)[] - prop6?: (string | null) | (partial_types.Nested | null)[] | null - nested_attrs?: ((string | null) | ((null | null) | null) | (partial_types.Nested | null) | null)[] - parens?: (string | null) | ((null | null) | null) | null - other_group?: (string | null) | ((number | null) | (string | null) | null) | null - } - - export interface SearchParams { - dateRange: (number | null) | null - location?: (string | null)[] - jobTitle: (partial_types.WithReasoning | null) | null - company: (partial_types.WithReasoning | null) | null - description?: (partial_types.WithReasoning | null)[] - tags?: ((Tag | null) | (string | null) | null)[] - } - - export interface SemanticContainer { - sixteen_digit_number?: number | null - string_with_twenty_words: string - class_1?: partial_types.ClassWithoutDone | null - class_2: types.ClassWithBlockDone - class_done_needed: types.ClassWithBlockDone - class_needed: partial_types.ClassWithoutDone - three_small_things?: (partial_types.SmallThing | null)[] - final_string?: string | null - } - - export interface SmallThing { - i_16_digits: number - i_8_digits?: number | null - } - - export interface SomeClassNestedDynamic { - hi?: string | null - [key: string]: any - } - - export interface StringToClassEntry { - word?: string | null - } - - export interface TestClassAlias { - key?: string | null - key2?: string | null - key3?: string | null - key4?: string | null - key5?: string | null - } - - export interface TestClassNested { - prop1?: string | null - prop2?: partial_types.InnerClass | null - } - - export interface TestClassWithEnum { - prop1?: string | null - prop2?: EnumInClass | null - } - - export interface TestMemoryOutput { - items?: ( - | (partial_types.MemoryObject | null) - | (partial_types.ComplexMemoryObject | null) - | (partial_types.AnotherObject | null) - | null - )[] - more_items?: ( - | (partial_types.MemoryObject | null) - | (partial_types.ComplexMemoryObject | null) - | (partial_types.AnotherObject | null) - | null - )[] - } - - export interface TestOutputClass { - prop1?: string | null - prop2?: number | null - } - - export interface Tree { - data?: number | null - children?: partial_types.Forest | null - } - - export interface TwoStoriesOneTitle { - title?: string | null - story_a?: string | null - story_b?: string | null - } - - export interface UnionTest_ReturnType { - prop1?: (string | null) | (boolean | null) | null - prop2?: ((number | null) | (boolean | null) | null)[] - prop3?: (boolean | null)[] | (number | null)[] | null - } - - /** - * my docs + * A Martian organism with an age. + * Such a nice type. + */ + export interface Martian { + /** + * The age of the Martian in Mars years. + * So many Mars years. */ - export interface UniverseQuestion { - question?: string | null - answer?: string | null - } - - export interface UniverseQuestionInput { - question?: string | null - } - - export interface WithReasoning { - value?: string | null - reasoning?: string | null - } -} + age?: Checked<(number | null),"young_enough"> + } + + export interface MemoryObject { + id?: (string | null) + name?: (string | null) + description?: (string | null) + } + + export interface MergeAttrs { + amount?: Checked<(number | null),"gt_ten"> + } + + export interface NamedArgsSingleClass { + key?: (string | null) + key_two?: (boolean | null) + key_three?: (number | null) + } + + export interface Nested { + prop3?: ((string | null) | ((null | null) | null) | null) + prop4?: ((string | null) | ((null | null) | null) | null) + prop20?: (partial_types.Nested2 | null) + } + + export interface Nested2 { + prop11?: ((string | null) | ((null | null) | null) | null) + prop12?: ((string | null) | ((null | null) | null) | null) + } + + export interface NestedBlockConstraint { + nbc?: Checked<(partial_types.BlockConstraint | null),"cross_field"> + } + + export interface NestedBlockConstraintForParam { + nbcfp?: (partial_types.BlockConstraintForParam | null) + } + + export interface Node { + data?: (number | null) + next: ((partial_types.Node | null) | null) + } + + export interface NodeWithAliasIndirection { + value?: (number | null) + next: ((partial_types.NodeWithAliasIndirection | null) | null) + } + + export interface OptionalListAndMap { + p: ((string | null)[] | null) + q: ((Record | null) | null) + } + + export interface OptionalTest_Prop1 { + omega_a?: (string | null) + omega_b?: (number | null) + } + + export interface OptionalTest_ReturnType { + omega_1: ((partial_types.OptionalTest_Prop1 | null) | null) + omega_2: ((string | null) | null) + omega_3?: ((OptionalTest_CategoryType | null) | null)[] + } + + export interface OrderInfo { + order_status?: (OrderStatus | null) + tracking_number: ((string | null) | null) + estimated_arrival_date: ((string | null) | null) + } + + export interface OriginalA { + value?: (number | null) + } + + export interface OriginalB { + value?: (number | null) + [key: string]: any; + } + + export interface Person { + name: ((string | null) | null) + hair_color: ((string | Color | null) | null) + [key: string]: any; + } + + export interface PhoneNumber { + value?: (string | null) + } + + export interface Quantity { + amount?: ((number | null) | (number | null) | null) + unit: ((string | null) | null) + } + + export interface RaysData { + dataType?: (DataType | null) + value?: ((partial_types.Resume | null) | (partial_types.Event | null) | null) + } + + export interface ReceiptInfo { + items?: (partial_types.ReceiptItem | null)[] + total_cost: ((number | null) | null) + venue?: ("barisa" | "ox_burger" | null) + } + + export interface ReceiptItem { + name?: (string | null) + description: ((string | null) | null) + quantity?: (number | null) + price?: (number | null) + } + + export interface Recipe { + ingredients?: (Record | null) + recipe_type?: ("breakfast" | "dinner" | null) + } + + export interface RecursiveAliasDependency { + value?: JsonValue + } + + export interface Resume { + name?: (string | null) + email?: (string | null) + phone?: (string | null) + experience?: (partial_types.Education | null)[] + education?: (string | null)[] + skills?: (string | null)[] + } + + export interface Schema { + prop1?: ((string | null) | ((null | null) | null) | null) + prop2?: ((partial_types.Nested | null) | (string | null) | null) + prop5?: ((string | null) | ((null | null) | null) | null)[] + prop6?: ((string | null) | (partial_types.Nested | null)[] | null) + nested_attrs?: ((string | null) | ((null | null) | null) | (partial_types.Nested | null) | null)[] + parens?: ((string | null) | ((null | null) | null) | null) + other_group?: ((string | null) | ((number | null) | (string | null) | null) | null) + } + + export interface SearchParams { + dateRange: ((number | null) | null) + location?: (string | null)[] + jobTitle: ((partial_types.WithReasoning | null) | null) + company: ((partial_types.WithReasoning | null) | null) + description?: (partial_types.WithReasoning | null)[] + tags?: ((Tag | null) | (string | null) | null)[] + } + + export interface SemanticContainer { + sixteen_digit_number?: (number | null) + string_with_twenty_words: string + class_1?: (partial_types.ClassWithoutDone | null) + class_2: types.ClassWithBlockDone + class_done_needed: types.ClassWithBlockDone + class_needed: partial_types.ClassWithoutDone + three_small_things?: (partial_types.SmallThing | null)[] + final_string?: (string | null) + } + + export interface SimpleTag { + field?: (string | null) + } + + export interface SmallThing { + i_16_digits: number + i_8_digits?: (number | null) + } + + export interface SomeClassNestedDynamic { + hi?: (string | null) + [key: string]: any; + } + + export interface StringToClassEntry { + word?: (string | null) + } + + export interface TestClassAlias { + key?: (string | null) + key2?: (string | null) + key3?: (string | null) + key4?: (string | null) + key5?: (string | null) + } + + export interface TestClassNested { + prop1?: (string | null) + prop2?: (partial_types.InnerClass | null) + } + + export interface TestClassWithEnum { + prop1?: (string | null) + prop2?: (EnumInClass | null) + } + + export interface TestMemoryOutput { + items?: ((partial_types.MemoryObject | null) | (partial_types.ComplexMemoryObject | null) | (partial_types.AnotherObject | null) | null)[] + more_items?: ((partial_types.MemoryObject | null) | (partial_types.ComplexMemoryObject | null) | (partial_types.AnotherObject | null) | null)[] + } + + export interface TestOutputClass { + prop1?: (string | null) + prop2?: (number | null) + } + + export interface Tree { + data?: (number | null) + children?: (partial_types.Forest | null) + } + + export interface TwoStoriesOneTitle { + title?: (string | null) + story_a?: (string | null) + story_b?: (string | null) + } + + export interface UnionTest_ReturnType { + prop1?: ((string | null) | (boolean | null) | null) + prop2?: ((number | null) | (boolean | null) | null)[] + prop3?: ((boolean | null)[] | (number | null)[] | null) + } + + /** + * my docs + */ + export interface UniverseQuestion { + question?: (string | null) + answer?: (string | null) + } + + export interface UniverseQuestionInput { + question?: (string | null) + } + + export interface WithReasoning { + value?: (string | null) + reasoning?: (string | null) + } + +} \ No newline at end of file diff --git a/integ-tests/typescript/baml_client/sync_client.ts b/integ-tests/typescript/baml_client/sync_client.ts index f24aa3d75..5c6e070ac 100644 --- a/integ-tests/typescript/baml_client/sync_client.ts +++ b/integ-tests/typescript/baml_client/sync_client.ts @@ -16,130 +16,10 @@ $ pnpm add @boundaryml/baml // @ts-nocheck // biome-ignore format: autogenerated code import { type BamlCtxManager, type BamlRuntime, BamlValidationError, type ClientRegistry, FunctionResult, type Image, createBamlValidationError } from "@boundaryml/baml" -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' -import type TypeBuilder from './type_builder' -import type { Check, Checked, RecursivePartialNull as MovedRecursivePartialNull } from './types' -import type { - AliasedEnum, - AnotherObject, - BigNumbers, - BinaryNode, - Blah, - BlockConstraint, - BlockConstraintForParam, - BookOrder, - Category, - Category2, - Category3, - ClassForNullLiteral, - ClassOptionalOutput, - ClassOptionalOutput2, - ClassToRecAlias, - ClassWithBlockDone, - ClassWithImage, - ClassWithoutDone, - Color, - ComplexMemoryObject, - CompoundBigNumbers, - ContactInfo, - CustomTaskResult, - DataType, - DummyOutput, - DynEnumOne, - DynEnumTwo, - DynInputOutput, - DynamicClassOne, - DynamicClassTwo, - DynamicOutput, - Earthling, - Education, - Email, - EmailAddress, - EnumInClass, - EnumOutput, - Event, - FakeImage, - FlightConfirmation, - FooAny, - Forest, - FormatterTest0, - FormatterTest1, - FormatterTest2, - FormatterTest3, - GroceryReceipt, - Hobby, - InnerClass, - InnerClass2, - InputClass, - InputClassNested, - JsonArray, - JsonObject, - JsonValue, - LinkedList, - LinkedListAliasNode, - LiteralClassHello, - LiteralClassOne, - LiteralClassTwo, - MalformedConstraints, - MalformedConstraints2, - MapKey, - Martian, - MemoryObject, - MergeAttrs, - NamedArgsSingleClass, - NamedArgsSingleEnum, - NamedArgsSingleEnumList, - Nested, - Nested2, - NestedBlockConstraint, - NestedBlockConstraintForParam, - Node, - NodeWithAliasIndirection, - OptionalListAndMap, - OptionalTest_CategoryType, - OptionalTest_Prop1, - OptionalTest_ReturnType, - OrderInfo, - OrderStatus, - OriginalA, - OriginalB, - Person, - PhoneNumber, - Quantity, - RaysData, - RecAliasOne, - RecAliasThree, - RecAliasTwo, - ReceiptInfo, - ReceiptItem, - Recipe, - RecursiveAliasDependency, - RecursiveListAlias, - RecursiveMapAlias, - Resume, - Schema, - SearchParams, - SemanticContainer, - SmallThing, - SomeClassNestedDynamic, - StringToClassEntry, - Tag, - TestClassAlias, - TestClassNested, - TestClassWithEnum, - TestEnum, - TestMemoryOutput, - TestOutputClass, - Tree, - TwoStoriesOneTitle, - UnionTest_ReturnType, - UniverseQuestion, - UniverseQuestionInput, - WithReasoning, -} from './types' +import type { Checked, Check, RecursivePartialNull as MovedRecursivePartialNull } from "./types" +import type {AliasedEnum, AnotherObject, BigNumbers, BinaryNode, Blah, BlockConstraint, BlockConstraintForParam, BookOrder, Category, Category2, Category3, ClassForNullLiteral, ClassOptionalOutput, ClassOptionalOutput2, ClassToRecAlias, ClassWithBlockDone, ClassWithImage, ClassWithoutDone, Color, ComplexMemoryObject, CompoundBigNumbers, ContactInfo, CustomTaskResult, DataType, DummyOutput, DynEnumOne, DynEnumTwo, DynInputOutput, DynamicClassOne, DynamicClassTwo, DynamicOutput, Earthling, Education, Email, EmailAddress, EnumInClass, EnumOutput, Event, FakeImage, FlightConfirmation, FooAny, Forest, FormatterTest0, FormatterTest1, FormatterTest2, FormatterTest3, GroceryReceipt, Hobby, InnerClass, InnerClass2, InputClass, InputClassNested, JsonArray, JsonEntry, JsonObject, JsonTemplate, JsonValue, LinkedList, LinkedListAliasNode, LiteralClassHello, LiteralClassOne, LiteralClassTwo, MalformedConstraints, MalformedConstraints2, MapKey, Martian, MemoryObject, MergeAttrs, NamedArgsSingleClass, NamedArgsSingleEnum, NamedArgsSingleEnumList, Nested, Nested2, NestedBlockConstraint, NestedBlockConstraintForParam, Node, NodeWithAliasIndirection, OptionalListAndMap, OptionalTest_CategoryType, OptionalTest_Prop1, OptionalTest_ReturnType, OrderInfo, OrderStatus, OriginalA, OriginalB, Person, PhoneNumber, Quantity, RaysData, RecAliasOne, RecAliasThree, RecAliasTwo, ReceiptInfo, ReceiptItem, Recipe, RecursiveAliasDependency, RecursiveListAlias, RecursiveMapAlias, Resume, Schema, SearchParams, SemanticContainer, SimpleTag, SmallThing, SomeClassNestedDynamic, StringToClassEntry, Tag, TestClassAlias, TestClassNested, TestClassWithEnum, TestEnum, TestMemoryOutput, TestOutputClass, Tree, TwoStoriesOneTitle, UnionTest_ReturnType, UniverseQuestion, UniverseQuestionInput, WithReasoning} from "./types" +import type 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" /** * @deprecated Use RecursivePartialNull from 'baml_client/types' instead. @@ -148,3784 +28,3947 @@ import type { * import { RecursivePartialNull } from './baml_client/types' * ``` */ -export type RecursivePartialNull = MovedRecursivePartialNull +export type RecursivePartialNull = MovedRecursivePartialNull; export class BamlSyncClient { - constructor( - private runtime: BamlRuntime, - private ctx_manager: BamlCtxManager, - ) {} + + constructor(private runtime: BamlRuntime, private ctx_manager: BamlCtxManager) {} /* - * @deprecated NOT IMPLEMENTED as streaming must by async. We - * are not providing an async version as we want to reserve the - * right to provide a sync version in the future. - */ + * @deprecated NOT IMPLEMENTED as streaming must by async. We + * are not providing an async version as we want to reserve the + * right to provide a sync version in the future. + */ get stream() { throw new Error("stream is not available in BamlSyncClient. Use `import { b } from 'baml_client/async_client") } - AaaSamOutputFormat(recipe: string, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): Recipe { + + AaaSamOutputFormat( + recipe: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Recipe { try { - const raw = this.runtime.callFunctionSync( - 'AaaSamOutputFormat', - { - recipe: recipe, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as Recipe + const raw = this.runtime.callFunctionSync( + "AaaSamOutputFormat", + { + "recipe": recipe + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as Recipe } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + AliasThatPointsToRecursiveType( - list: LinkedListAliasNode, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + list: LinkedListAliasNode, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): LinkedListAliasNode { try { - const raw = this.runtime.callFunctionSync( - 'AliasThatPointsToRecursiveType', - { - list: list, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as LinkedListAliasNode + const raw = this.runtime.callFunctionSync( + "AliasThatPointsToRecursiveType", + { + "list": list + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as LinkedListAliasNode } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + AliasWithMultipleAttrs( - money: Checked, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): Checked { + money: Checked, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Checked { try { - const raw = this.runtime.callFunctionSync( - 'AliasWithMultipleAttrs', - { - money: money, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as Checked + const raw = this.runtime.callFunctionSync( + "AliasWithMultipleAttrs", + { + "money": money + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as Checked } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + AliasedInputClass( - input: InputClass, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: InputClass, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'AliasedInputClass', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "AliasedInputClass", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + AliasedInputClass2( - input: InputClass, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: InputClass, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'AliasedInputClass2', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "AliasedInputClass2", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + AliasedInputClassNested( - input: InputClassNested, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: InputClassNested, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'AliasedInputClassNested', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "AliasedInputClassNested", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + AliasedInputEnum( - input: AliasedEnum, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: AliasedEnum, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'AliasedInputEnum', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "AliasedInputEnum", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + AliasedInputList( - input: AliasedEnum[], - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: AliasedEnum[], + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'AliasedInputList', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "AliasedInputList", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + AllowedOptionals( - optionals: OptionalListAndMap, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + optionals: OptionalListAndMap, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): OptionalListAndMap { try { - const raw = this.runtime.callFunctionSync( - 'AllowedOptionals', - { - optionals: optionals, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as OptionalListAndMap + const raw = this.runtime.callFunctionSync( + "AllowedOptionals", + { + "optionals": optionals + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as OptionalListAndMap } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - AssertFn(a: number, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): number { + + AssertFn( + a: number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): number { try { - const raw = this.runtime.callFunctionSync( - 'AssertFn', - { - a: a, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as number + const raw = this.runtime.callFunctionSync( + "AssertFn", + { + "a": a + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as number } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - AudioInput(aud: Audio, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): string { + + AudioInput( + aud: Audio, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): string { try { - const raw = this.runtime.callFunctionSync( - 'AudioInput', - { - aud: aud, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "AudioInput", + { + "aud": aud + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + BuildLinkedList( - input: number[], - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: number[], + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): LinkedList { try { - const raw = this.runtime.callFunctionSync( - 'BuildLinkedList', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as LinkedList + const raw = this.runtime.callFunctionSync( + "BuildLinkedList", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as LinkedList } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - BuildTree(input: BinaryNode, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): Tree { + + BuildTree( + input: BinaryNode, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Tree { try { - const raw = this.runtime.callFunctionSync( - 'BuildTree', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as Tree + const raw = this.runtime.callFunctionSync( + "BuildTree", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as Tree } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + ClassThatPointsToRecursiveClassThroughAlias( - cls: ClassToRecAlias, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + cls: ClassToRecAlias, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): ClassToRecAlias { try { - const raw = this.runtime.callFunctionSync( - 'ClassThatPointsToRecursiveClassThroughAlias', - { - cls: cls, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as ClassToRecAlias + const raw = this.runtime.callFunctionSync( + "ClassThatPointsToRecursiveClassThroughAlias", + { + "cls": cls + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as ClassToRecAlias } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + ClassifyDynEnumTwo( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): string | DynEnumTwo { + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): (string | DynEnumTwo) { try { - const raw = this.runtime.callFunctionSync( - 'ClassifyDynEnumTwo', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string | DynEnumTwo + const raw = this.runtime.callFunctionSync( + "ClassifyDynEnumTwo", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as (string | DynEnumTwo) } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - ClassifyMessage(input: string, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): Category { + + ClassifyMessage( + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Category { try { - const raw = this.runtime.callFunctionSync( - 'ClassifyMessage', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as Category + const raw = this.runtime.callFunctionSync( + "ClassifyMessage", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as Category } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - ClassifyMessage2(input: string, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): Category { + + ClassifyMessage2( + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Category { try { - const raw = this.runtime.callFunctionSync( - 'ClassifyMessage2', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as Category + const raw = this.runtime.callFunctionSync( + "ClassifyMessage2", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as Category } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - ClassifyMessage3(input: string, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): Category { + + ClassifyMessage3( + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Category { try { - const raw = this.runtime.callFunctionSync( - 'ClassifyMessage3', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as Category + const raw = this.runtime.callFunctionSync( + "ClassifyMessage3", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as Category } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + Completion( - prefix: string, - suffix: string, - language: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + prefix: string,suffix: string,language: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'Completion', - { - prefix: prefix, - suffix: suffix, - language: language, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "Completion", + { + "prefix": prefix,"suffix": suffix,"language": language + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + CustomTask( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BookOrder | FlightConfirmation | GroceryReceipt { try { - const raw = this.runtime.callFunctionSync( - 'CustomTask', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as BookOrder | FlightConfirmation | GroceryReceipt + const raw = this.runtime.callFunctionSync( + "CustomTask", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as BookOrder | FlightConfirmation | GroceryReceipt } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - DescribeImage(img: Image, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): string { + + DescribeImage( + img: Image, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): string { try { - const raw = this.runtime.callFunctionSync( - 'DescribeImage', - { - img: img, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "DescribeImage", + { + "img": img + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + DescribeImage2( - classWithImage: ClassWithImage, - img2: Image, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + classWithImage: ClassWithImage,img2: Image, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'DescribeImage2', - { - classWithImage: classWithImage, - img2: img2, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "DescribeImage2", + { + "classWithImage": classWithImage,"img2": img2 + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + DescribeImage3( - classWithImage: ClassWithImage, - img2: Image, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + classWithImage: ClassWithImage,img2: Image, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'DescribeImage3', - { - classWithImage: classWithImage, - img2: img2, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "DescribeImage3", + { + "classWithImage": classWithImage,"img2": img2 + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + DescribeImage4( - classWithImage: ClassWithImage, - img2: Image, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + classWithImage: ClassWithImage,img2: Image, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'DescribeImage4', - { - classWithImage: classWithImage, - img2: img2, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "DescribeImage4", + { + "classWithImage": classWithImage,"img2": img2 + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - DifferentiateUnions(__baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): OriginalA | OriginalB { + + DifferentiateUnions( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): OriginalA | OriginalB { try { - const raw = this.runtime.callFunctionSync( - 'DifferentiateUnions', - {}, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as OriginalA | OriginalB + const raw = this.runtime.callFunctionSync( + "DifferentiateUnions", + { + + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as OriginalA | OriginalB } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + DummyOutputFunction( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): DummyOutput { try { - const raw = this.runtime.callFunctionSync( - 'DummyOutputFunction', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as DummyOutput + const raw = this.runtime.callFunctionSync( + "DummyOutputFunction", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as DummyOutput } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + DynamicFunc( - input: DynamicClassOne, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: DynamicClassOne, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): DynamicClassTwo { try { - const raw = this.runtime.callFunctionSync( - 'DynamicFunc', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as DynamicClassTwo + const raw = this.runtime.callFunctionSync( + "DynamicFunc", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as DynamicClassTwo } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + DynamicInputOutput( - input: DynInputOutput, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: DynInputOutput, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): DynInputOutput { try { - const raw = this.runtime.callFunctionSync( - 'DynamicInputOutput', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as DynInputOutput + const raw = this.runtime.callFunctionSync( + "DynamicInputOutput", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as DynInputOutput } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + DynamicListInputOutput( - input: DynInputOutput[], - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: DynInputOutput[], + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): DynInputOutput[] { try { - const raw = this.runtime.callFunctionSync( - 'DynamicListInputOutput', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as DynInputOutput[] + const raw = this.runtime.callFunctionSync( + "DynamicListInputOutput", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as DynInputOutput[] } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - ExpectFailure(__baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): string { + + ExpectFailure( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): string { try { - const raw = this.runtime.callFunctionSync( - 'ExpectFailure', - {}, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "ExpectFailure", + { + + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + ExtractContactInfo( - document: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + document: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): ContactInfo { try { - const raw = this.runtime.callFunctionSync( - 'ExtractContactInfo', - { - document: document, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as ContactInfo + const raw = this.runtime.callFunctionSync( + "ExtractContactInfo", + { + "document": document + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as ContactInfo } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + ExtractHobby( - text: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + text: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): (string | Hobby)[] { try { - const raw = this.runtime.callFunctionSync( - 'ExtractHobby', - { - text: text, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as (string | Hobby)[] + const raw = this.runtime.callFunctionSync( + "ExtractHobby", + { + "text": text + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as (string | Hobby)[] } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - ExtractNames(input: string, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): string[] { + + ExtractNames( + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): string[] { try { - const raw = this.runtime.callFunctionSync( - 'ExtractNames', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string[] + const raw = this.runtime.callFunctionSync( + "ExtractNames", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string[] } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - ExtractPeople(text: string, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): Person[] { + + ExtractPeople( + text: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Person[] { try { - const raw = this.runtime.callFunctionSync( - 'ExtractPeople', - { - text: text, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as Person[] + const raw = this.runtime.callFunctionSync( + "ExtractPeople", + { + "text": text + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as Person[] } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + ExtractReceiptInfo( - email: string, - reason: 'curiosity' | 'personal_finance', - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + email: string,reason: "curiosity" | "personal_finance", + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): ReceiptInfo { try { - const raw = this.runtime.callFunctionSync( - 'ExtractReceiptInfo', - { - email: email, - reason: reason, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as ReceiptInfo + const raw = this.runtime.callFunctionSync( + "ExtractReceiptInfo", + { + "email": email,"reason": reason + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as ReceiptInfo } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + ExtractResume( - resume: string, - img?: Image | null, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + resume: string,img?: Image | null, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Resume { try { - const raw = this.runtime.callFunctionSync( - 'ExtractResume', - { - resume: resume, - img: img ?? null, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as Resume + const raw = this.runtime.callFunctionSync( + "ExtractResume", + { + "resume": resume,"img": img?? null + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as Resume } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - ExtractResume2(resume: string, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): Resume { + + ExtractResume2( + resume: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Resume { try { - const raw = this.runtime.callFunctionSync( - 'ExtractResume2', - { - resume: resume, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as Resume + const raw = this.runtime.callFunctionSync( + "ExtractResume2", + { + "resume": resume + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as Resume } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + FnClassOptionalOutput( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): ClassOptionalOutput | null { try { - const raw = this.runtime.callFunctionSync( - 'FnClassOptionalOutput', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as ClassOptionalOutput | null + const raw = this.runtime.callFunctionSync( + "FnClassOptionalOutput", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as ClassOptionalOutput | null } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + FnClassOptionalOutput2( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): ClassOptionalOutput2 | null { try { - const raw = this.runtime.callFunctionSync( - 'FnClassOptionalOutput2', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as ClassOptionalOutput2 | null + const raw = this.runtime.callFunctionSync( + "FnClassOptionalOutput2", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as ClassOptionalOutput2 | null } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + FnEnumListOutput( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): EnumOutput[] { try { - const raw = this.runtime.callFunctionSync( - 'FnEnumListOutput', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as EnumOutput[] + const raw = this.runtime.callFunctionSync( + "FnEnumListOutput", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as EnumOutput[] } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - FnEnumOutput(input: string, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): EnumOutput { + + FnEnumOutput( + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): EnumOutput { try { - const raw = this.runtime.callFunctionSync( - 'FnEnumOutput', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as EnumOutput + const raw = this.runtime.callFunctionSync( + "FnEnumOutput", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as EnumOutput } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + FnLiteralClassInputOutput( - input: LiteralClassHello, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: LiteralClassHello, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): LiteralClassHello { try { - const raw = this.runtime.callFunctionSync( - 'FnLiteralClassInputOutput', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as LiteralClassHello + const raw = this.runtime.callFunctionSync( + "FnLiteralClassInputOutput", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as LiteralClassHello } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + FnLiteralUnionClassInputOutput( - input: LiteralClassOne | LiteralClassTwo, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: LiteralClassOne | LiteralClassTwo, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): LiteralClassOne | LiteralClassTwo { try { - const raw = this.runtime.callFunctionSync( - 'FnLiteralUnionClassInputOutput', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as LiteralClassOne | LiteralClassTwo + const raw = this.runtime.callFunctionSync( + "FnLiteralUnionClassInputOutput", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as LiteralClassOne | LiteralClassTwo } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + FnNamedArgsSingleStringOptional( - myString?: string | null, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myString?: string | null, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'FnNamedArgsSingleStringOptional', - { - myString: myString ?? null, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "FnNamedArgsSingleStringOptional", + { + "myString": myString?? null + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - FnOutputBool(input: string, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): boolean { + + FnOutputBool( + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): boolean { try { - const raw = this.runtime.callFunctionSync( - 'FnOutputBool', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as boolean + const raw = this.runtime.callFunctionSync( + "FnOutputBool", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as boolean } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + FnOutputClass( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): TestOutputClass { try { - const raw = this.runtime.callFunctionSync( - 'FnOutputClass', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as TestOutputClass + const raw = this.runtime.callFunctionSync( + "FnOutputClass", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as TestOutputClass } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + FnOutputClassList( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): TestOutputClass[] { try { - const raw = this.runtime.callFunctionSync( - 'FnOutputClassList', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as TestOutputClass[] + const raw = this.runtime.callFunctionSync( + "FnOutputClassList", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as TestOutputClass[] } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + FnOutputClassNested( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): TestClassNested { try { - const raw = this.runtime.callFunctionSync( - 'FnOutputClassNested', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as TestClassNested + const raw = this.runtime.callFunctionSync( + "FnOutputClassNested", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as TestClassNested } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + FnOutputClassWithEnum( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): TestClassWithEnum { try { - const raw = this.runtime.callFunctionSync( - 'FnOutputClassWithEnum', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as TestClassWithEnum + const raw = this.runtime.callFunctionSync( + "FnOutputClassWithEnum", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as TestClassWithEnum } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - FnOutputInt(input: string, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): number { + + FnOutputInt( + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): number { try { - const raw = this.runtime.callFunctionSync( - 'FnOutputInt', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as number + const raw = this.runtime.callFunctionSync( + "FnOutputInt", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as number } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - FnOutputLiteralBool(input: string, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): false { + + FnOutputLiteralBool( + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): false { try { - const raw = this.runtime.callFunctionSync( - 'FnOutputLiteralBool', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as false + const raw = this.runtime.callFunctionSync( + "FnOutputLiteralBool", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as false } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - FnOutputLiteralInt(input: string, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): 5 { + + FnOutputLiteralInt( + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): 5 { try { - const raw = this.runtime.callFunctionSync( - 'FnOutputLiteralInt', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as 5 + const raw = this.runtime.callFunctionSync( + "FnOutputLiteralInt", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as 5 } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + FnOutputLiteralString( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): 'example output' { + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): "example output" { try { - const raw = this.runtime.callFunctionSync( - 'FnOutputLiteralString', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as 'example output' + const raw = this.runtime.callFunctionSync( + "FnOutputLiteralString", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as "example output" } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + FnOutputStringList( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string[] { try { - const raw = this.runtime.callFunctionSync( - 'FnOutputStringList', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string[] + const raw = this.runtime.callFunctionSync( + "FnOutputStringList", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string[] } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + FnTestAliasedEnumOutput( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): TestEnum { try { - const raw = this.runtime.callFunctionSync( - 'FnTestAliasedEnumOutput', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as TestEnum + const raw = this.runtime.callFunctionSync( + "FnTestAliasedEnumOutput", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as TestEnum } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + FnTestClassAlias( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): TestClassAlias { try { - const raw = this.runtime.callFunctionSync( - 'FnTestClassAlias', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as TestClassAlias + const raw = this.runtime.callFunctionSync( + "FnTestClassAlias", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as TestClassAlias } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + FnTestNamedArgsSingleEnum( - myArg: NamedArgsSingleEnum, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myArg: NamedArgsSingleEnum, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'FnTestNamedArgsSingleEnum', - { - myArg: myArg, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "FnTestNamedArgsSingleEnum", + { + "myArg": myArg + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - GetDataType(text: string, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): RaysData { + + GetDataType( + text: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): RaysData { try { - const raw = this.runtime.callFunctionSync( - 'GetDataType', - { - text: text, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as RaysData + const raw = this.runtime.callFunctionSync( + "GetDataType", + { + "text": text + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as RaysData } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - GetOrderInfo(email: Email, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): OrderInfo { + + GetOrderInfo( + email: Email, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): OrderInfo { try { - const raw = this.runtime.callFunctionSync( - 'GetOrderInfo', - { - email: email, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as OrderInfo + const raw = this.runtime.callFunctionSync( + "GetOrderInfo", + { + "email": email + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as OrderInfo } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - GetQuery(query: string, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): SearchParams { + + GetQuery( + query: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): SearchParams { try { - const raw = this.runtime.callFunctionSync( - 'GetQuery', - { - query: query, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as SearchParams + const raw = this.runtime.callFunctionSync( + "GetQuery", + { + "query": query + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as SearchParams } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + InOutEnumMapKey( - i1: Partial>, - i2: Partial>, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + i1: Partial>,i2: Partial>, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Partial> { try { - const raw = this.runtime.callFunctionSync( - 'InOutEnumMapKey', - { - i1: i1, - i2: i2, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as Partial> + const raw = this.runtime.callFunctionSync( + "InOutEnumMapKey", + { + "i1": i1,"i2": i2 + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as Partial> } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + InOutLiteralStringUnionMapKey( - i1: Partial>, - i2: Partial>, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): Partial> { + i1: Partial>,i2: Partial>, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Partial> { try { - const raw = this.runtime.callFunctionSync( - 'InOutLiteralStringUnionMapKey', - { - i1: i1, - i2: i2, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as Partial> + const raw = this.runtime.callFunctionSync( + "InOutLiteralStringUnionMapKey", + { + "i1": i1,"i2": i2 + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as Partial> } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + InOutSingleLiteralStringMapKey( - m: Partial>, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): Partial> { + m: Partial>, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Partial> { try { - const raw = this.runtime.callFunctionSync( - 'InOutSingleLiteralStringMapKey', - { - m: m, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as Partial> + const raw = this.runtime.callFunctionSync( + "InOutSingleLiteralStringMapKey", + { + "m": m + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as Partial> } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + JsonTypeAliasCycle( - input: JsonValue, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: JsonValue, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): JsonValue { try { - const raw = this.runtime.callFunctionSync( - 'JsonTypeAliasCycle', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as JsonValue + const raw = this.runtime.callFunctionSync( + "JsonTypeAliasCycle", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as JsonValue } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + LiteralUnionsTest( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): 1 | true | 'string output' { + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): 1 | true | "string output" { try { - const raw = this.runtime.callFunctionSync( - 'LiteralUnionsTest', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as 1 | true | 'string output' + const raw = this.runtime.callFunctionSync( + "LiteralUnionsTest", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as 1 | true | "string output" } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - MakeBlockConstraint(__baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): Checked< - BlockConstraint, - 'cross_field' - > { + + MakeBlockConstraint( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Checked { try { - const raw = this.runtime.callFunctionSync( - 'MakeBlockConstraint', - {}, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as Checked + const raw = this.runtime.callFunctionSync( + "MakeBlockConstraint", + { + + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as Checked } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - MakeNestedBlockConstraint(__baml_options__?: { - tb?: TypeBuilder - clientRegistry?: ClientRegistry - }): NestedBlockConstraint { + + MakeNestedBlockConstraint( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): NestedBlockConstraint { try { - const raw = this.runtime.callFunctionSync( - 'MakeNestedBlockConstraint', - {}, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as NestedBlockConstraint + const raw = this.runtime.callFunctionSync( + "MakeNestedBlockConstraint", + { + + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as NestedBlockConstraint } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - MakeSemanticContainer(__baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): SemanticContainer { + + MakeSemanticContainer( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): SemanticContainer { try { - const raw = this.runtime.callFunctionSync( - 'MakeSemanticContainer', - {}, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as SemanticContainer + const raw = this.runtime.callFunctionSync( + "MakeSemanticContainer", + { + + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as SemanticContainer } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + MapAlias( - m: Record, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + m: Record, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Record { try { - const raw = this.runtime.callFunctionSync( - 'MapAlias', - { - m: m, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as Record + const raw = this.runtime.callFunctionSync( + "MapAlias", + { + "m": m + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as Record } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + MergeAliasAttributes( - money: number, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + money: number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): MergeAttrs { try { - const raw = this.runtime.callFunctionSync( - 'MergeAliasAttributes', - { - money: money, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as MergeAttrs + const raw = this.runtime.callFunctionSync( + "MergeAliasAttributes", + { + "money": money + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as MergeAttrs } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - MyFunc(input: string, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): DynamicOutput { + + MyFunc( + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): DynamicOutput { try { - const raw = this.runtime.callFunctionSync( - 'MyFunc', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as DynamicOutput + const raw = this.runtime.callFunctionSync( + "MyFunc", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as DynamicOutput } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + NestedAlias( - c: number | string | boolean | number | string[] | Record, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + c: number | string | boolean | number | string[] | Record, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): number | string | boolean | number | string[] | Record { try { - const raw = this.runtime.callFunctionSync( - 'NestedAlias', - { - c: c, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as number | string | boolean | number | string[] | Record + const raw = this.runtime.callFunctionSync( + "NestedAlias", + { + "c": c + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as number | string | boolean | number | string[] | Record } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + NullLiteralClassHello( - s: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + s: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): ClassForNullLiteral { try { - const raw = this.runtime.callFunctionSync( - 'NullLiteralClassHello', - { - s: s, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as ClassForNullLiteral + const raw = this.runtime.callFunctionSync( + "NullLiteralClassHello", + { + "s": s + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as ClassForNullLiteral } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + OptionalTest_Function( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): (OptionalTest_ReturnType | null)[] { try { - const raw = this.runtime.callFunctionSync( - 'OptionalTest_Function', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as (OptionalTest_ReturnType | null)[] + const raw = this.runtime.callFunctionSync( + "OptionalTest_Function", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as (OptionalTest_ReturnType | null)[] } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - PredictAge(name: string, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): FooAny { + + PredictAge( + name: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): FooAny { try { - const raw = this.runtime.callFunctionSync( - 'PredictAge', - { - name: name, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as FooAny + const raw = this.runtime.callFunctionSync( + "PredictAge", + { + "name": name + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as FooAny } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + PredictAgeBare( - inp: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): Checked { + inp: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Checked { try { - const raw = this.runtime.callFunctionSync( - 'PredictAgeBare', - { - inp: inp, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as Checked + const raw = this.runtime.callFunctionSync( + "PredictAgeBare", + { + "inp": inp + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as Checked } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + PrimitiveAlias( - p: number | string | boolean | number, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + p: number | string | boolean | number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): number | string | boolean | number { try { - const raw = this.runtime.callFunctionSync( - 'PrimitiveAlias', - { - p: p, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as number | string | boolean | number + const raw = this.runtime.callFunctionSync( + "PrimitiveAlias", + { + "p": p + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as number | string | boolean | number } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - PromptTestClaude(input: string, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): string { + + PromptTestClaude( + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): string { try { - const raw = this.runtime.callFunctionSync( - 'PromptTestClaude', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "PromptTestClaude", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + PromptTestClaudeChat( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'PromptTestClaudeChat', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "PromptTestClaudeChat", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + PromptTestClaudeChatNoSystem( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'PromptTestClaudeChatNoSystem', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "PromptTestClaudeChatNoSystem", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - PromptTestOpenAI(input: string, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): string { + + PromptTestOpenAI( + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): string { try { - const raw = this.runtime.callFunctionSync( - 'PromptTestOpenAI', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "PromptTestOpenAI", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + PromptTestOpenAIChat( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'PromptTestOpenAIChat', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "PromptTestOpenAIChat", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + PromptTestOpenAIChatNoSystem( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'PromptTestOpenAIChatNoSystem', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "PromptTestOpenAIChatNoSystem", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - PromptTestStreaming(input: string, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): string { + + PromptTestStreaming( + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): string { try { - const raw = this.runtime.callFunctionSync( - 'PromptTestStreaming', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "PromptTestStreaming", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + RecursiveAliasCycle( - input: RecAliasOne, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: RecAliasOne, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): RecAliasOne { try { - const raw = this.runtime.callFunctionSync( - 'RecursiveAliasCycle', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as RecAliasOne + const raw = this.runtime.callFunctionSync( + "RecursiveAliasCycle", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as RecAliasOne } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + RecursiveClassWithAliasIndirection( - cls: NodeWithAliasIndirection, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + cls: NodeWithAliasIndirection, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): NodeWithAliasIndirection { try { - const raw = this.runtime.callFunctionSync( - 'RecursiveClassWithAliasIndirection', - { - cls: cls, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as NodeWithAliasIndirection + const raw = this.runtime.callFunctionSync( + "RecursiveClassWithAliasIndirection", + { + "cls": cls + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as NodeWithAliasIndirection } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + ReturnAliasWithMergedAttributes( - money: Checked, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, - ): Checked { + money: Checked, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Checked { try { - const raw = this.runtime.callFunctionSync( - 'ReturnAliasWithMergedAttributes', - { - money: money, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as Checked + const raw = this.runtime.callFunctionSync( + "ReturnAliasWithMergedAttributes", + { + "money": money + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as Checked } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - ReturnFailingAssert(inp: number, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): number { + + ReturnFailingAssert( + inp: number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): number { try { - const raw = this.runtime.callFunctionSync( - 'ReturnFailingAssert', - { - inp: inp, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as number + const raw = this.runtime.callFunctionSync( + "ReturnFailingAssert", + { + "inp": inp + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as number } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } + + ReturnJsonEntry( + s: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): JsonTemplate { + try { + const raw = this.runtime.callFunctionSync( + "ReturnJsonEntry", + { + "s": s + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as JsonTemplate + } catch (error: any) { + const bamlError = createBamlValidationError(error); + if (bamlError instanceof BamlValidationError) { + throw bamlError; + } + throw error; + } + } + ReturnMalformedConstraints( - a: number, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + a: number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): MalformedConstraints { try { - const raw = this.runtime.callFunctionSync( - 'ReturnMalformedConstraints', - { - a: a, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as MalformedConstraints + const raw = this.runtime.callFunctionSync( + "ReturnMalformedConstraints", + { + "a": a + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as MalformedConstraints } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - SchemaDescriptions(input: string, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): Schema { + + SchemaDescriptions( + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): Schema { try { - const raw = this.runtime.callFunctionSync( - 'SchemaDescriptions', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as Schema + const raw = this.runtime.callFunctionSync( + "SchemaDescriptions", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as Schema } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + SimpleRecursiveListAlias( - input: RecursiveListAlias, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: RecursiveListAlias, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): RecursiveListAlias { try { - const raw = this.runtime.callFunctionSync( - 'SimpleRecursiveListAlias', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as RecursiveListAlias + const raw = this.runtime.callFunctionSync( + "SimpleRecursiveListAlias", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as RecursiveListAlias } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + SimpleRecursiveMapAlias( - input: RecursiveMapAlias, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: RecursiveMapAlias, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): RecursiveMapAlias { try { - const raw = this.runtime.callFunctionSync( - 'SimpleRecursiveMapAlias', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as RecursiveMapAlias + const raw = this.runtime.callFunctionSync( + "SimpleRecursiveMapAlias", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as RecursiveMapAlias } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + StreamBigNumbers( - digits: number, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + digits: number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): BigNumbers { try { - const raw = this.runtime.callFunctionSync( - 'StreamBigNumbers', - { - digits: digits, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as BigNumbers + const raw = this.runtime.callFunctionSync( + "StreamBigNumbers", + { + "digits": digits + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as BigNumbers } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + StreamFailingAssertion( - theme: string, - length: number, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + theme: string,length: number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): TwoStoriesOneTitle { try { - const raw = this.runtime.callFunctionSync( - 'StreamFailingAssertion', - { - theme: theme, - length: length, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as TwoStoriesOneTitle + const raw = this.runtime.callFunctionSync( + "StreamFailingAssertion", + { + "theme": theme,"length": length + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as TwoStoriesOneTitle } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - StreamOneBigNumber(digits: number, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): number { + + StreamOneBigNumber( + digits: number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): number { try { - const raw = this.runtime.callFunctionSync( - 'StreamOneBigNumber', - { - digits: digits, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as number + const raw = this.runtime.callFunctionSync( + "StreamOneBigNumber", + { + "digits": digits + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as number } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + StreamUnionIntegers( - digits: number, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + digits: number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): (number | string)[] { try { - const raw = this.runtime.callFunctionSync( - 'StreamUnionIntegers', - { - digits: digits, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as (number | string)[] + const raw = this.runtime.callFunctionSync( + "StreamUnionIntegers", + { + "digits": digits + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as (number | string)[] } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + StreamingCompoundNumbers( - digits: number, - yapping: boolean, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + digits: number,yapping: boolean, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): CompoundBigNumbers { try { - const raw = this.runtime.callFunctionSync( - 'StreamingCompoundNumbers', - { - digits: digits, - yapping: yapping, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as CompoundBigNumbers + const raw = this.runtime.callFunctionSync( + "StreamingCompoundNumbers", + { + "digits": digits,"yapping": yapping + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as CompoundBigNumbers } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TakeRecAliasDep( - input: RecursiveAliasDependency, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: RecursiveAliasDependency, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): RecursiveAliasDependency { try { - const raw = this.runtime.callFunctionSync( - 'TakeRecAliasDep', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as RecursiveAliasDependency + const raw = this.runtime.callFunctionSync( + "TakeRecAliasDep", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as RecursiveAliasDependency } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - TestAnthropic(input: string, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): string { + + TestAnthropic( + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestAnthropic', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestAnthropic", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestAnthropicShorthand( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestAnthropicShorthand', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestAnthropicShorthand", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - TestAws(input: string, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): string { + + TestAws( + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestAws', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestAws", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestAwsInvalidAccessKey( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestAwsInvalidAccessKey', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestAwsInvalidAccessKey", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestAwsInvalidProfile( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestAwsInvalidProfile', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestAwsInvalidProfile", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestAwsInvalidRegion( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestAwsInvalidRegion', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestAwsInvalidRegion", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestAwsInvalidSessionToken( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestAwsInvalidSessionToken', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestAwsInvalidSessionToken", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - TestAzure(input: string, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): string { + + TestAzure( + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestAzure', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestAzure", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - TestAzureFailure(input: string, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): string { + + TestAzureFailure( + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestAzureFailure', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestAzureFailure", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestAzureO1NoMaxTokens( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestAzureO1NoMaxTokens', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestAzureO1NoMaxTokens", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestAzureO1WithMaxCompletionTokens( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestAzureO1WithMaxCompletionTokens', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestAzureO1WithMaxCompletionTokens", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestAzureO1WithMaxTokens( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestAzureO1WithMaxTokens', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestAzureO1WithMaxTokens", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestAzureWithMaxTokens( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestAzureWithMaxTokens', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestAzureWithMaxTokens", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestCaching( - input: string, - not_cached: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string,not_cached: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestCaching', - { - input: input, - not_cached: not_cached, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestCaching", + { + "input": input,"not_cached": not_cached + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - TestFallbackClient(__baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): string { + + TestFallbackClient( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestFallbackClient', - {}, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestFallbackClient", + { + + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestFallbackToShorthand( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestFallbackToShorthand', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestFallbackToShorthand", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestFnNamedArgsSingleBool( - myBool: boolean, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myBool: boolean, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestFnNamedArgsSingleBool', - { - myBool: myBool, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestFnNamedArgsSingleBool", + { + "myBool": myBool + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestFnNamedArgsSingleClass( - myArg: NamedArgsSingleClass, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myArg: NamedArgsSingleClass, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestFnNamedArgsSingleClass', - { - myArg: myArg, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestFnNamedArgsSingleClass", + { + "myArg": myArg + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestFnNamedArgsSingleEnumList( - myArg: NamedArgsSingleEnumList[], - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myArg: NamedArgsSingleEnumList[], + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestFnNamedArgsSingleEnumList', - { - myArg: myArg, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestFnNamedArgsSingleEnumList", + { + "myArg": myArg + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestFnNamedArgsSingleFloat( - myFloat: number, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myFloat: number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestFnNamedArgsSingleFloat', - { - myFloat: myFloat, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestFnNamedArgsSingleFloat", + { + "myFloat": myFloat + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestFnNamedArgsSingleInt( - myInt: number, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myInt: number, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestFnNamedArgsSingleInt', - { - myInt: myInt, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestFnNamedArgsSingleInt", + { + "myInt": myInt + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestFnNamedArgsSingleMapStringToClass( - myMap: Record, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myMap: Record, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Record { try { - const raw = this.runtime.callFunctionSync( - 'TestFnNamedArgsSingleMapStringToClass', - { - myMap: myMap, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as Record + const raw = this.runtime.callFunctionSync( + "TestFnNamedArgsSingleMapStringToClass", + { + "myMap": myMap + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as Record } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestFnNamedArgsSingleMapStringToMap( - myMap: Record>, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myMap: Record>, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Record> { try { - const raw = this.runtime.callFunctionSync( - 'TestFnNamedArgsSingleMapStringToMap', - { - myMap: myMap, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as Record> + const raw = this.runtime.callFunctionSync( + "TestFnNamedArgsSingleMapStringToMap", + { + "myMap": myMap + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as Record> } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestFnNamedArgsSingleMapStringToString( - myMap: Record, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myMap: Record, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): Record { try { - const raw = this.runtime.callFunctionSync( - 'TestFnNamedArgsSingleMapStringToString', - { - myMap: myMap, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as Record + const raw = this.runtime.callFunctionSync( + "TestFnNamedArgsSingleMapStringToString", + { + "myMap": myMap + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as Record } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestFnNamedArgsSingleString( - myString: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myString: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestFnNamedArgsSingleString', - { - myString: myString, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestFnNamedArgsSingleString", + { + "myString": myString + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestFnNamedArgsSingleStringArray( - myStringArray: string[], - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myStringArray: string[], + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestFnNamedArgsSingleStringArray', - { - myStringArray: myStringArray, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestFnNamedArgsSingleStringArray", + { + "myStringArray": myStringArray + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestFnNamedArgsSingleStringList( - myArg: string[], - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myArg: string[], + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestFnNamedArgsSingleStringList', - { - myArg: myArg, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestFnNamedArgsSingleStringList", + { + "myArg": myArg + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - TestGemini(input: string, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): string { + + TestGemini( + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestGemini', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestGemini", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - TestGeminiOpenAiGeneric(__baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): string { + + TestGeminiOpenAiGeneric( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestGeminiOpenAiGeneric', - {}, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestGeminiOpenAiGeneric", + { + + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - TestGeminiSystem(input: string, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): string { + + TestGeminiSystem( + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestGeminiSystem', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestGeminiSystem", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestGeminiSystemAsChat( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestGeminiSystemAsChat', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestGeminiSystemAsChat", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - TestImageInput(img: Image, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): string { + + TestImageInput( + img: Image, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestImageInput', - { - img: img, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestImageInput", + { + "img": img + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestImageInputAnthropic( - img: Image, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + img: Image, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestImageInputAnthropic', - { - img: img, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestImageInputAnthropic", + { + "img": img + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - TestImageListInput(imgs: Image[], __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): string { + + TestImageListInput( + imgs: Image[], + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestImageListInput', - { - imgs: imgs, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestImageListInput", + { + "imgs": imgs + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestMemory( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): TestMemoryOutput { try { - const raw = this.runtime.callFunctionSync( - 'TestMemory', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as TestMemoryOutput + const raw = this.runtime.callFunctionSync( + "TestMemory", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as TestMemoryOutput } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestMulticlassNamedArgs( - myArg: NamedArgsSingleClass, - myArg2: NamedArgsSingleClass, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myArg: NamedArgsSingleClass,myArg2: NamedArgsSingleClass, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestMulticlassNamedArgs', - { - myArg: myArg, - myArg2: myArg2, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestMulticlassNamedArgs", + { + "myArg": myArg,"myArg2": myArg2 + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestNamedArgsLiteralBool( - myBool: true, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myBool: true, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestNamedArgsLiteralBool', - { - myBool: myBool, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestNamedArgsLiteralBool", + { + "myBool": myBool + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - TestNamedArgsLiteralInt(myInt: 1, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): string { + + TestNamedArgsLiteralInt( + myInt: 1, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestNamedArgsLiteralInt', - { - myInt: myInt, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestNamedArgsLiteralInt", + { + "myInt": myInt + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestNamedArgsLiteralString( - myString: 'My String', - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + myString: "My String", + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestNamedArgsLiteralString', - { - myString: myString, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestNamedArgsLiteralString", + { + "myString": myString + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - TestOllama(input: string, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): string { + + TestOllama( + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestOllama', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestOllama", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - TestOpenAI(input: string, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): string { + + TestOpenAI( + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestOpenAI', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestOpenAI", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestOpenAILegacyProvider( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestOpenAILegacyProvider', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestOpenAILegacyProvider", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestOpenAIO1NoMaxTokens( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestOpenAIO1NoMaxTokens', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestOpenAIO1NoMaxTokens", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestOpenAIO1WithMaxCompletionTokens( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestOpenAIO1WithMaxCompletionTokens', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestOpenAIO1WithMaxCompletionTokens", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestOpenAIO1WithMaxTokens( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestOpenAIO1WithMaxTokens', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestOpenAIO1WithMaxTokens", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - TestOpenAIShorthand(input: string, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): string { + + TestOpenAIShorthand( + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestOpenAIShorthand', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestOpenAIShorthand", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestOpenAIWithMaxTokens( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestOpenAIWithMaxTokens', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestOpenAIWithMaxTokens", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestOpenAIWithNullMaxTokens( - input: string, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestOpenAIWithNullMaxTokens', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestOpenAIWithNullMaxTokens", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - TestRetryConstant(__baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): string { + + TestRetryConstant( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestRetryConstant', - {}, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestRetryConstant", + { + + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - TestRetryExponential(__baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): string { + + TestRetryExponential( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestRetryExponential', - {}, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestRetryExponential", + { + + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - TestSingleFallbackClient(__baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): string { + + TestSingleFallbackClient( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestUniverseQuestion', - { - question: question, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as UniverseQuestion + const raw = this.runtime.callFunctionSync( + "TestSingleFallbackClient", + { + + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + TestUniverseQuestion( - question: UniverseQuestionInput, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + question: UniverseQuestionInput, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): UniverseQuestion { try { - const raw = this.runtime.callFunctionSync( - 'TestUniverseQuestion', - { - question: question, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as UniverseQuestion + const raw = this.runtime.callFunctionSync( + "TestUniverseQuestion", + { + "question": question + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as UniverseQuestion } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - TestVertex(input: string, __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): string { + + TestVertex( + input: string, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestVertex', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestVertex", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - - TestVertexWithSystemInstructions(__baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }): string { + + TestVertexWithSystemInstructions( + + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } + ): string { try { - const raw = this.runtime.callFunctionSync( - 'TestVertexWithSystemInstructions', - {}, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as string + const raw = this.runtime.callFunctionSync( + "TestVertexWithSystemInstructions", + { + + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as string } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + UnionTest_Function( - input: string | boolean, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + input: string | boolean, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): UnionTest_ReturnType { try { - const raw = this.runtime.callFunctionSync( - 'UnionTest_Function', - { - input: input, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as UnionTest_ReturnType + const raw = this.runtime.callFunctionSync( + "UnionTest_Function", + { + "input": input + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as UnionTest_ReturnType } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + UseBlockConstraint( - inp: BlockConstraintForParam, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + inp: BlockConstraintForParam, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): number { try { - const raw = this.runtime.callFunctionSync( - 'UseBlockConstraint', - { - inp: inp, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as number + const raw = this.runtime.callFunctionSync( + "UseBlockConstraint", + { + "inp": inp + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as number } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + UseMalformedConstraints( - a: MalformedConstraints2, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + a: MalformedConstraints2, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): number { try { - const raw = this.runtime.callFunctionSync( - 'UseMalformedConstraints', - { - a: a, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as number + const raw = this.runtime.callFunctionSync( + "UseMalformedConstraints", + { + "a": a + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as number } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } - + UseNestedBlockConstraint( - inp: NestedBlockConstraintForParam, - __baml_options__?: { tb?: TypeBuilder; clientRegistry?: ClientRegistry }, + inp: NestedBlockConstraintForParam, + __baml_options__?: { tb?: TypeBuilder, clientRegistry?: ClientRegistry } ): number { try { - const raw = this.runtime.callFunctionSync( - 'UseNestedBlockConstraint', - { - inp: inp, - }, - this.ctx_manager.cloneContext(), - __baml_options__?.tb?.__tb(), - __baml_options__?.clientRegistry, - ) - return raw.parsed(false) as number + const raw = this.runtime.callFunctionSync( + "UseNestedBlockConstraint", + { + "inp": inp + }, + this.ctx_manager.cloneContext(), + __baml_options__?.tb?.__tb(), + __baml_options__?.clientRegistry, + ) + return raw.parsed(false) as number } catch (error: any) { - const bamlError = createBamlValidationError(error) + const bamlError = createBamlValidationError(error); if (bamlError instanceof BamlValidationError) { - throw bamlError + throw bamlError; } - throw error + throw error; } } + } -export const b = new BamlSyncClient( - DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_RUNTIME, - DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_CTX, -) +export const b = new BamlSyncClient(DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_RUNTIME, DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_CTX) \ No newline at end of file diff --git a/integ-tests/typescript/baml_client/type_builder.ts b/integ-tests/typescript/baml_client/type_builder.ts index a5a152b4f..7f114f972 100644 --- a/integ-tests/typescript/baml_client/type_builder.ts +++ b/integ-tests/typescript/baml_client/type_builder.ts @@ -17,229 +17,151 @@ $ pnpm add @boundaryml/baml // biome-ignore format: autogenerated code import type { FieldType } from '@boundaryml/baml/native' import { TypeBuilder as _TypeBuilder } from '@boundaryml/baml/type_builder' -import type { ClassBuilder, EnumBuilder } from '@boundaryml/baml/type_builder' +import type { EnumBuilder, ClassBuilder } from '@boundaryml/baml/type_builder' export default class TypeBuilder { - private tb: _TypeBuilder - - DummyOutput: ClassBuilder<'DummyOutput', 'nonce' | 'nonce2'> - - DynInputOutput: ClassBuilder<'DynInputOutput', 'testKey'> - - DynamicClassOne: ClassBuilder<'DynamicClassOne'> - - DynamicClassTwo: ClassBuilder<'DynamicClassTwo', 'hi' | 'some_class' | 'status'> - - DynamicOutput: ClassBuilder<'DynamicOutput'> - - OriginalB: ClassBuilder<'OriginalB', 'value'> - - Person: ClassBuilder<'Person', 'name' | 'hair_color'> - - SomeClassNestedDynamic: ClassBuilder<'SomeClassNestedDynamic', 'hi'> - - Color: EnumBuilder<'Color', 'RED' | 'BLUE' | 'GREEN' | 'YELLOW' | 'BLACK' | 'WHITE'> - - DynEnumOne: EnumBuilder<'DynEnumOne'> - - DynEnumTwo: EnumBuilder<'DynEnumTwo'> - - Hobby: EnumBuilder<'Hobby', 'SPORTS' | 'MUSIC' | 'READING'> - - constructor() { - this.tb = new _TypeBuilder({ - classes: new Set([ - 'AnotherObject', - 'BigNumbers', - 'BinaryNode', - 'Blah', - 'BlockConstraint', - 'BlockConstraintForParam', - 'BookOrder', - 'ClassForNullLiteral', - 'ClassOptionalOutput', - 'ClassOptionalOutput2', - 'ClassToRecAlias', - 'ClassWithBlockDone', - 'ClassWithImage', - 'ClassWithoutDone', - 'ComplexMemoryObject', - 'CompoundBigNumbers', - 'ContactInfo', - 'CustomTaskResult', - 'DummyOutput', - 'DynInputOutput', - 'DynamicClassOne', - 'DynamicClassTwo', - 'DynamicOutput', - 'Earthling', - 'Education', - 'Email', - 'EmailAddress', - 'Event', - 'FakeImage', - 'FlightConfirmation', - 'FooAny', - 'Forest', - 'FormatterTest0', - 'FormatterTest1', - 'FormatterTest2', - 'FormatterTest3', - 'GroceryReceipt', - 'InnerClass', - 'InnerClass2', - 'InputClass', - 'InputClassNested', - 'LinkedList', - 'LinkedListAliasNode', - 'LiteralClassHello', - 'LiteralClassOne', - 'LiteralClassTwo', - 'MalformedConstraints', - 'MalformedConstraints2', - 'Martian', - 'MemoryObject', - 'MergeAttrs', - 'NamedArgsSingleClass', - 'Nested', - 'Nested2', - 'NestedBlockConstraint', - 'NestedBlockConstraintForParam', - 'Node', - 'NodeWithAliasIndirection', - 'OptionalListAndMap', - 'OptionalTest_Prop1', - 'OptionalTest_ReturnType', - 'OrderInfo', - 'OriginalA', - 'OriginalB', - 'Person', - 'PhoneNumber', - 'Quantity', - 'RaysData', - 'ReceiptInfo', - 'ReceiptItem', - 'Recipe', - 'RecursiveAliasDependency', - 'Resume', - 'Schema', - 'SearchParams', - 'SemanticContainer', - 'SmallThing', - 'SomeClassNestedDynamic', - 'StringToClassEntry', - 'TestClassAlias', - 'TestClassNested', - 'TestClassWithEnum', - 'TestMemoryOutput', - 'TestOutputClass', - 'Tree', - 'TwoStoriesOneTitle', - 'UnionTest_ReturnType', - 'UniverseQuestion', - 'UniverseQuestionInput', - 'WithReasoning', - ]), - enums: new Set([ - 'AliasedEnum', - 'Category', - 'Category2', - 'Category3', - 'Color', - 'DataType', - 'DynEnumOne', - 'DynEnumTwo', - 'EnumInClass', - 'EnumOutput', - 'Hobby', - 'MapKey', - 'NamedArgsSingleEnum', - 'NamedArgsSingleEnumList', - 'OptionalTest_CategoryType', - 'OrderStatus', - 'Tag', - 'TestEnum', - ]), - }) - - this.DummyOutput = this.tb.classBuilder('DummyOutput', ['nonce', 'nonce2']) - - this.DynInputOutput = this.tb.classBuilder('DynInputOutput', ['testKey']) - - this.DynamicClassOne = this.tb.classBuilder('DynamicClassOne', []) - - this.DynamicClassTwo = this.tb.classBuilder('DynamicClassTwo', ['hi', 'some_class', 'status']) - - this.DynamicOutput = this.tb.classBuilder('DynamicOutput', []) - - this.OriginalB = this.tb.classBuilder('OriginalB', ['value']) - - this.Person = this.tb.classBuilder('Person', ['name', 'hair_color']) - - this.SomeClassNestedDynamic = this.tb.classBuilder('SomeClassNestedDynamic', ['hi']) - - this.Color = this.tb.enumBuilder('Color', ['RED', 'BLUE', 'GREEN', 'YELLOW', 'BLACK', 'WHITE']) - - this.DynEnumOne = this.tb.enumBuilder('DynEnumOne', []) - - this.DynEnumTwo = this.tb.enumBuilder('DynEnumTwo', []) - - this.Hobby = this.tb.enumBuilder('Hobby', ['SPORTS', 'MUSIC', 'READING']) - } - - __tb() { - return this.tb._tb() - } - - string(): FieldType { - return this.tb.string() - } - - literalString(value: string): FieldType { - return this.tb.literalString(value) - } - - literalInt(value: number): FieldType { - return this.tb.literalInt(value) - } - - literalBool(value: boolean): FieldType { - return this.tb.literalBool(value) - } - - int(): FieldType { - return this.tb.int() - } - - float(): FieldType { - return this.tb.float() - } - - bool(): FieldType { - return this.tb.bool() - } - - list(type: FieldType): FieldType { - return this.tb.list(type) - } - - null(): FieldType { - return this.tb.null() - } - - map(key: FieldType, value: FieldType): FieldType { - return this.tb.map(key, value) - } - - union(types: FieldType[]): FieldType { - return this.tb.union(types) - } - - addClass(name: Name): ClassBuilder { - return this.tb.addClass(name) - } - - addEnum(name: Name): EnumBuilder { - return this.tb.addEnum(name) - } -} + private tb: _TypeBuilder; + + DummyOutput: ClassBuilder<'DummyOutput', "nonce" | "nonce2">; + + DynInputOutput: ClassBuilder<'DynInputOutput', "testKey">; + + DynamicClassOne: ClassBuilder<'DynamicClassOne'>; + + DynamicClassTwo: ClassBuilder<'DynamicClassTwo', "hi" | "some_class" | "status">; + + DynamicOutput: ClassBuilder<'DynamicOutput'>; + + OriginalB: ClassBuilder<'OriginalB', "value">; + + Person: ClassBuilder<'Person', "name" | "hair_color">; + + SomeClassNestedDynamic: ClassBuilder<'SomeClassNestedDynamic', "hi">; + + + Color: EnumBuilder<'Color', "RED" | "BLUE" | "GREEN" | "YELLOW" | "BLACK" | "WHITE">; + + DynEnumOne: EnumBuilder<'DynEnumOne'>; + + DynEnumTwo: EnumBuilder<'DynEnumTwo'>; + + Hobby: EnumBuilder<'Hobby', "SPORTS" | "MUSIC" | "READING">; + + + constructor() { + this.tb = new _TypeBuilder({ + classes: new Set([ + "AnotherObject","BigNumbers","BinaryNode","Blah","BlockConstraint","BlockConstraintForParam","BookOrder","ClassForNullLiteral","ClassOptionalOutput","ClassOptionalOutput2","ClassToRecAlias","ClassWithBlockDone","ClassWithImage","ClassWithoutDone","ComplexMemoryObject","CompoundBigNumbers","ContactInfo","CustomTaskResult","DummyOutput","DynInputOutput","DynamicClassOne","DynamicClassTwo","DynamicOutput","Earthling","Education","Email","EmailAddress","Event","FakeImage","FlightConfirmation","FooAny","Forest","FormatterTest0","FormatterTest1","FormatterTest2","FormatterTest3","GroceryReceipt","InnerClass","InnerClass2","InputClass","InputClassNested","LinkedList","LinkedListAliasNode","LiteralClassHello","LiteralClassOne","LiteralClassTwo","MalformedConstraints","MalformedConstraints2","Martian","MemoryObject","MergeAttrs","NamedArgsSingleClass","Nested","Nested2","NestedBlockConstraint","NestedBlockConstraintForParam","Node","NodeWithAliasIndirection","OptionalListAndMap","OptionalTest_Prop1","OptionalTest_ReturnType","OrderInfo","OriginalA","OriginalB","Person","PhoneNumber","Quantity","RaysData","ReceiptInfo","ReceiptItem","Recipe","RecursiveAliasDependency","Resume","Schema","SearchParams","SemanticContainer","SimpleTag","SmallThing","SomeClassNestedDynamic","StringToClassEntry","TestClassAlias","TestClassNested","TestClassWithEnum","TestMemoryOutput","TestOutputClass","Tree","TwoStoriesOneTitle","UnionTest_ReturnType","UniverseQuestion","UniverseQuestionInput","WithReasoning", + ]), + enums: new Set([ + "AliasedEnum","Category","Category2","Category3","Color","DataType","DynEnumOne","DynEnumTwo","EnumInClass","EnumOutput","Hobby","MapKey","NamedArgsSingleEnum","NamedArgsSingleEnumList","OptionalTest_CategoryType","OrderStatus","Tag","TestEnum", + ]) + }); + + this.DummyOutput = this.tb.classBuilder("DummyOutput", [ + "nonce","nonce2", + ]); + + this.DynInputOutput = this.tb.classBuilder("DynInputOutput", [ + "testKey", + ]); + + this.DynamicClassOne = this.tb.classBuilder("DynamicClassOne", [ + + ]); + + this.DynamicClassTwo = this.tb.classBuilder("DynamicClassTwo", [ + "hi","some_class","status", + ]); + + this.DynamicOutput = this.tb.classBuilder("DynamicOutput", [ + + ]); + + this.OriginalB = this.tb.classBuilder("OriginalB", [ + "value", + ]); + + this.Person = this.tb.classBuilder("Person", [ + "name","hair_color", + ]); + + this.SomeClassNestedDynamic = this.tb.classBuilder("SomeClassNestedDynamic", [ + "hi", + ]); + + + this.Color = this.tb.enumBuilder("Color", [ + "RED","BLUE","GREEN","YELLOW","BLACK","WHITE", + ]); + + this.DynEnumOne = this.tb.enumBuilder("DynEnumOne", [ + + ]); + + this.DynEnumTwo = this.tb.enumBuilder("DynEnumTwo", [ + + ]); + + this.Hobby = this.tb.enumBuilder("Hobby", [ + "SPORTS","MUSIC","READING", + ]); + + } + + __tb() { + return this.tb._tb(); + } + + string(): FieldType { + return this.tb.string() + } + + literalString(value: string): FieldType { + return this.tb.literalString(value) + } + + literalInt(value: number): FieldType { + return this.tb.literalInt(value) + } + + literalBool(value: boolean): FieldType { + return this.tb.literalBool(value) + } + + int(): FieldType { + return this.tb.int() + } + + float(): FieldType { + return this.tb.float() + } + + bool(): FieldType { + return this.tb.bool() + } + + list(type: FieldType): FieldType { + return this.tb.list(type) + } + + null(): FieldType { + return this.tb.null() + } + + map(key: FieldType, value: FieldType): FieldType { + return this.tb.map(key, value) + } + + union(types: FieldType[]): FieldType { + return this.tb.union(types) + } + + addClass(name: Name): ClassBuilder { + return this.tb.addClass(name); + } + + addEnum(name: Name): EnumBuilder { + return this.tb.addEnum(name); + } +} \ No newline at end of file diff --git a/integ-tests/typescript/baml_client/types.ts b/integ-tests/typescript/baml_client/types.ts index 60e35d8bb..2c1841635 100644 --- a/integ-tests/typescript/baml_client/types.ts +++ b/integ-tests/typescript/baml_client/types.ts @@ -15,78 +15,82 @@ $ pnpm add @boundaryml/baml // tslint:disable // @ts-nocheck // biome-ignore format: autogenerated code -import type { Audio, Image } from "@boundaryml/baml" +import type { Image, Audio } from "@boundaryml/baml" -export type RecursivePartialNull = T extends object ? { [P in keyof T]?: RecursivePartialNull } : T | null +export type RecursivePartialNull = T extends object + ? { [P in keyof T]?: RecursivePartialNull } + : T | null; -export interface Checked { - value: T - checks: Record +export interface Checked { + value: T, + checks: Record, } export interface Check { - name: string - expr: string - status: 'succeeded' | 'failed' + name: string, + expr: string + status: "succeeded" | "failed" } export function all_succeeded(checks: Record): boolean { - return get_checks(checks).every((check) => check.status === 'succeeded') + return get_checks(checks).every(check => check.status === "succeeded") } export function get_checks(checks: Record): Check[] { - return Object.values(checks) + return Object.values(checks) } export enum AliasedEnum { - KEY_ONE = 'KEY_ONE', - KEY_TWO = 'KEY_TWO', + KEY_ONE = "KEY_ONE", + KEY_TWO = "KEY_TWO", } export enum Category { - Refund = 'Refund', - CancelOrder = 'CancelOrder', - TechnicalSupport = 'TechnicalSupport', - AccountIssue = 'AccountIssue', - Question = 'Question', + Refund = "Refund", + CancelOrder = "CancelOrder", + TechnicalSupport = "TechnicalSupport", + AccountIssue = "AccountIssue", + Question = "Question", } export enum Category2 { - Refund = 'Refund', - CancelOrder = 'CancelOrder', - TechnicalSupport = 'TechnicalSupport', - AccountIssue = 'AccountIssue', - Question = 'Question', + Refund = "Refund", + CancelOrder = "CancelOrder", + TechnicalSupport = "TechnicalSupport", + AccountIssue = "AccountIssue", + Question = "Question", } export enum Category3 { - Refund = 'Refund', - CancelOrder = 'CancelOrder', - TechnicalSupport = 'TechnicalSupport', - AccountIssue = 'AccountIssue', - Question = 'Question', + Refund = "Refund", + CancelOrder = "CancelOrder", + TechnicalSupport = "TechnicalSupport", + AccountIssue = "AccountIssue", + Question = "Question", } export enum Color { - RED = 'RED', - BLUE = 'BLUE', - GREEN = 'GREEN', - YELLOW = 'YELLOW', - BLACK = 'BLACK', - WHITE = 'WHITE', + RED = "RED", + BLUE = "BLUE", + GREEN = "GREEN", + YELLOW = "YELLOW", + BLACK = "BLACK", + WHITE = "WHITE", } export enum DataType { - Resume = 'Resume', - Event = 'Event', + Resume = "Resume", + Event = "Event", } -export enum DynEnumOne {} +export enum DynEnumOne { +} -export enum DynEnumTwo {} +export enum DynEnumTwo { +} export enum EnumInClass { - ONE = 'ONE', - TWO = 'TWO', + ONE = "ONE", + TWO = "TWO", } /** @@ -97,94 +101,100 @@ export enum EnumOutput { /** * The first enum. */ - ONE = 'ONE', + ONE = "ONE", /** * The second enum. */ - TWO = 'TWO', - THREE = 'THREE', + TWO = "TWO", + THREE = "THREE", } export enum Hobby { - SPORTS = 'SPORTS', - MUSIC = 'MUSIC', - READING = 'READING', + SPORTS = "SPORTS", + MUSIC = "MUSIC", + READING = "READING", } export enum MapKey { - A = 'A', - B = 'B', - C = 'C', + A = "A", + B = "B", + C = "C", } export enum NamedArgsSingleEnum { - ONE = 'ONE', - TWO = 'TWO', + ONE = "ONE", + TWO = "TWO", } export enum NamedArgsSingleEnumList { - ONE = 'ONE', - TWO = 'TWO', + ONE = "ONE", + TWO = "TWO", } export enum OptionalTest_CategoryType { - Aleph = 'Aleph', - Beta = 'Beta', - Gamma = 'Gamma', + Aleph = "Aleph", + Beta = "Beta", + Gamma = "Gamma", } export enum OrderStatus { - ORDERED = 'ORDERED', - SHIPPED = 'SHIPPED', - DELIVERED = 'DELIVERED', - CANCELLED = 'CANCELLED', + ORDERED = "ORDERED", + SHIPPED = "SHIPPED", + DELIVERED = "DELIVERED", + CANCELLED = "CANCELLED", } export enum Tag { - Security = 'Security', - AI = 'AI', - Blockchain = 'Blockchain', + Security = "Security", + AI = "AI", + Blockchain = "Blockchain", } export enum TestEnum { - A = 'A', - B = 'B', - C = 'C', - D = 'D', - E = 'E', - F = 'F', - G = 'G', + A = "A", + B = "B", + C = "C", + D = "D", + E = "E", + F = "F", + G = "G", } export interface AnotherObject { id: string thingy2: string thingy3: string + } export interface BigNumbers { a: number b: number + } export interface BinaryNode { data: number left?: BinaryNode | null right?: BinaryNode | null + } export interface Blah { prop4?: string | null + } export interface BlockConstraint { foo: number bar: string + } export interface BlockConstraintForParam { bcfp: number bcfp2: string + } export interface BookOrder { @@ -192,41 +202,49 @@ export interface BookOrder { title: string quantity: number price: number + } export interface ClassForNullLiteral { - a: 'hi' + a: "hi" + } export interface ClassOptionalOutput { prop1: string prop2: string + } export interface ClassOptionalOutput2 { prop1?: string | null prop2?: string | null prop3?: Blah | null + } export interface ClassToRecAlias { list: LinkedListAliasNode + } export interface ClassWithBlockDone { i_16_digits: number s_20_words: string + } export interface ClassWithImage { myImage: Image param2: string fake_image: FakeImage + } export interface ClassWithoutDone { i_16_digits: number s_20_words: string + } export interface ComplexMemoryObject { @@ -234,56 +252,63 @@ export interface ComplexMemoryObject { name: string description: string metadata: (string | number | number)[] + } export interface CompoundBigNumbers { big: BigNumbers big_nums: BigNumbers[] another: BigNumbers + } export interface ContactInfo { primary: PhoneNumber | EmailAddress secondary?: PhoneNumber | EmailAddress | null + } export interface CustomTaskResult { bookOrder?: BookOrder | null | null flightConfirmation?: FlightConfirmation | null | null groceryReceipt?: GroceryReceipt | null | null + } export interface DummyOutput { nonce: string nonce2: string - - [key: string]: any + + [key: string]: any; } export interface DynInputOutput { testKey: string - - [key: string]: any + + [key: string]: any; } export interface DynamicClassOne { - [key: string]: any + + [key: string]: any; } export interface DynamicClassTwo { hi: string some_class: SomeClassNestedDynamic - status: string | DynEnumOne - - [key: string]: any + status: (string | DynEnumOne) + + [key: string]: any; } export interface DynamicOutput { - [key: string]: any + + [key: string]: any; } export interface Earthling { - age: Checked + age: Checked + } export interface Education { @@ -292,16 +317,19 @@ export interface Education { degree: string major: string[] graduation_date?: string | null + } export interface Email { subject: string body: string from_address: string + } export interface EmailAddress { value: string + } export interface Event { @@ -309,10 +337,12 @@ export interface Event { date: string location: string description: string + } export interface FakeImage { url: string + } export interface FlightConfirmation { @@ -321,36 +351,43 @@ export interface FlightConfirmation { departureTime: string arrivalTime: string seatNumber: string + } export interface FooAny { planetary_age: Martian | Earthling - certainty: Checked - species: Checked + certainty: Checked + species: Checked + } export interface Forest { trees: Tree[] + } export interface FormatterTest0 { lorem: string ipsum: string + } export interface FormatterTest1 { lorem: string ipsum: string + } export interface FormatterTest2 { lorem: string ipsum: string + } export interface FormatterTest3 { lorem: string ipsum: string + } export interface GroceryReceipt { @@ -358,57 +395,69 @@ export interface GroceryReceipt { storeName: string items: (string | number | number)[] totalAmount: number + } export interface InnerClass { prop1: string prop2: string inner: InnerClass2 + } export interface InnerClass2 { prop2: number prop3: number + } export interface InputClass { key: string key2: string + } export interface InputClassNested { key: string nested: InputClass + } export interface LinkedList { head?: Node | null len: number + } export interface LinkedListAliasNode { value: number next?: LinkedListAliasNode | null + } export interface LiteralClassHello { - prop: 'hello' + prop: "hello" + } export interface LiteralClassOne { - prop: 'one' + prop: "one" + } export interface LiteralClassTwo { - prop: 'two' + prop: "two" + } export interface MalformedConstraints { - foo: Checked + foo: Checked + } export interface MalformedConstraints2 { foo: number + } /** @@ -420,111 +469,130 @@ export interface Martian { * The age of the Martian in Mars years. * So many Mars years. */ - age: Checked + age: Checked + } export interface MemoryObject { id: string name: string description: string + } export interface MergeAttrs { - amount: Checked + amount: Checked + } export interface NamedArgsSingleClass { key: string key_two: boolean key_three: number + } export interface Nested { prop3?: string | null | null prop4?: string | null | null prop20: Nested2 + } export interface Nested2 { prop11?: string | null | null prop12?: string | null | null + } export interface NestedBlockConstraint { - nbc: Checked + nbc: Checked + } export interface NestedBlockConstraintForParam { nbcfp: BlockConstraintForParam + } export interface Node { data: number next?: Node | null + } export interface NodeWithAliasIndirection { value: number next?: NodeWithAliasIndirection | null + } export interface OptionalListAndMap { p?: string[] | null q?: Record | null + } export interface OptionalTest_Prop1 { omega_a: string omega_b: number + } export interface OptionalTest_ReturnType { omega_1?: OptionalTest_Prop1 | null omega_2?: string | null omega_3: (OptionalTest_CategoryType | null)[] + } export interface OrderInfo { order_status: OrderStatus tracking_number?: string | null estimated_arrival_date?: string | null + } export interface OriginalA { value: number + } export interface OriginalB { value: number - - [key: string]: any + + [key: string]: any; } export interface Person { name?: string | null hair_color?: (string | Color) | null - - [key: string]: any + + [key: string]: any; } export interface PhoneNumber { value: string + } export interface Quantity { amount: number | number unit?: string | null + } export interface RaysData { dataType: DataType value: Resume | Event + } export interface ReceiptInfo { items: ReceiptItem[] total_cost?: number | null - venue: 'barisa' | 'ox_burger' + venue: "barisa" | "ox_burger" + } export interface ReceiptItem { @@ -532,15 +600,18 @@ export interface ReceiptItem { description?: string | null quantity: number price: number + } export interface Recipe { ingredients: Record - recipe_type: 'breakfast' | 'dinner' + recipe_type: "breakfast" | "dinner" + } export interface RecursiveAliasDependency { value: JsonValue + } export interface Resume { @@ -550,6 +621,7 @@ export interface Resume { experience: Education[] education: string[] skills: string[] + } export interface Schema { @@ -560,6 +632,7 @@ export interface Schema { nested_attrs: (string | null | null | Nested)[] parens?: string | null | null other_group: string | number | string + } export interface SearchParams { @@ -569,6 +642,7 @@ export interface SearchParams { company?: WithReasoning | null description: WithReasoning[] tags: (Tag | string)[] + } export interface SemanticContainer { @@ -580,25 +654,29 @@ export interface SemanticContainer { class_needed: ClassWithoutDone three_small_things: SmallThing[] final_string: string + } export interface SimpleTag { field: string + } export interface SmallThing { i_16_digits: number i_8_digits: number + } export interface SomeClassNestedDynamic { hi: string - - [key: string]: any + + [key: string]: any; } export interface StringToClassEntry { word: string + } export interface TestClassAlias { @@ -607,43 +685,51 @@ export interface TestClassAlias { key3: string key4: string key5: string + } export interface TestClassNested { prop1: string prop2: InnerClass + } export interface TestClassWithEnum { prop1: string prop2: EnumInClass + } export interface TestMemoryOutput { items: (MemoryObject | ComplexMemoryObject | AnotherObject)[] more_items: (MemoryObject | ComplexMemoryObject | AnotherObject)[] + } export interface TestOutputClass { prop1: string prop2: number + } export interface Tree { data: number children: Forest + } export interface TwoStoriesOneTitle { title: string story_a: string story_b: string + } export interface UnionTest_ReturnType { prop1: string | boolean prop2: (number | boolean)[] prop3: boolean[] | number[] + } /** @@ -652,33 +738,28 @@ export interface UnionTest_ReturnType { export interface UniverseQuestion { question: string answer: string + } export interface UniverseQuestionInput { question: string -} - -/** - * my docs - */ -export interface UniverseQuestion { - question: string - answer: string -} - -export interface UniverseQuestionInput { - question: string + } export interface WithReasoning { value: string reasoning: string + } export type JsonArray = JsonValue[] +export type JsonEntry = SimpleTag | JsonTemplate + export type JsonObject = Record +export type JsonTemplate = Record + export type JsonValue = number | string | boolean | number | JsonObject | JsonArray export type RecAliasOne = RecAliasTwo