diff --git a/integ-tests/baml_src/fiddle-examples/images/image.baml b/integ-tests/baml_src/fiddle-examples/images/image.baml index 6f8f6b91b..3ee59a6a1 100644 --- a/integ-tests/baml_src/fiddle-examples/images/image.baml +++ b/integ-tests/baml_src/fiddle-examples/images/image.baml @@ -65,6 +65,6 @@ function DescribeImage4(classWithImage: ClassWithImage, img2: image) -> string { test TestName { functions [DescribeImage] args { - img { url "http://imgs.xkcd.com/comics/standards.png" } + img { url "https://imgs.xkcd.com/comics/standards.png"} } } diff --git a/integ-tests/baml_src/test-files/functions/input/named-args/single/named-audio.baml b/integ-tests/baml_src/test-files/functions/input/named-args/single/named-audio.baml index a2a87aaaf..69cd1162f 100644 --- a/integ-tests/baml_src/test-files/functions/input/named-args/single/named-audio.baml +++ b/integ-tests/baml_src/test-files/functions/input/named-args/single/named-audio.baml @@ -1,21 +1,9 @@ -class Response { - type string - reason string - appropriate_for_video_games bool - score int @description(#" - 1-5, 1 being best at video game background music and 5 being worst - "#) -} - -function AudioInput(aud: audio) -> Response { +function AudioInput(aud: audio) -> string{ client Gemini prompt #" - Describe the sound. - - {{ ctx.output_format(prefix="Answer in this schema:\n") }} - - {{ _.role("user") }} + + Does this sound like a roar? Yes or no? One word no other characters. {{ aud }} "# diff --git a/integ-tests/baml_src/test-files/testing_pipeline/resume.baml b/integ-tests/baml_src/test-files/testing_pipeline/resume.baml index 25b9d54f3..9e48a5fae 100644 --- a/integ-tests/baml_src/test-files/testing_pipeline/resume.baml +++ b/integ-tests/baml_src/test-files/testing_pipeline/resume.baml @@ -2,8 +2,8 @@ class Resume { name string email string phone string - experience string[] - education Education[] + experience Education[] + education string[] skills string[] } @@ -12,9 +12,7 @@ class Education { location string degree string major string[] - date string? @alias(start_date) @description(#" - YYYY-MM - "#) + graduation_date string? } template_string AddRole(foo: string) #" @@ -31,6 +29,7 @@ function ExtractResume(resume: string, img: image?) -> Resume { Extract data: + <<<< {{ resume }} <<<< @@ -46,9 +45,9 @@ function ExtractResume(resume: string, img: image?) -> Resume { test sam_resume { functions [ExtractResume] input { - // img { - // url "https://avatars.githubusercontent.com/u/1016595?v=4" - // } + img { + url "https://avatars.githubusercontent.com/u/1016595?v=4" + } resume #" Sam Lijin he/him | jobs@sxlijin.com | sxlijin.github.io | 111-222-3333 | sxlijin | sxlijin diff --git a/integ-tests/python/baml_client/client.py b/integ-tests/python/baml_client/client.py index 5dfe49a3a..c2b05f054 100644 --- a/integ-tests/python/baml_client/client.py +++ b/integ-tests/python/baml_client/client.py @@ -59,7 +59,7 @@ async def AudioInput( self, aud: baml_py.Audio, baml_options: BamlCallOptions = {}, - ) -> types.Response: + ) -> str: __tb__ = baml_options.get("tb", None) if __tb__ is not None: tb = __tb__._tb @@ -74,7 +74,7 @@ async def AudioInput( self.__ctx_manager.get(), tb, ) - mdl = create_model("AudioInputReturnType", inner=(types.Response, ...)) + mdl = create_model("AudioInputReturnType", inner=(str, ...)) return coerce(mdl, raw.parsed()) async def ClassifyMessage( @@ -1433,7 +1433,7 @@ def AudioInput( self, aud: baml_py.Audio, baml_options: BamlCallOptions = {}, - ) -> baml_py.BamlStream[partial_types.Response, types.Response]: + ) -> baml_py.BamlStream[Optional[str], str]: __tb__ = baml_options.get("tb", None) if __tb__ is not None: tb = __tb__._tb @@ -1450,10 +1450,10 @@ def AudioInput( tb, ) - mdl = create_model("AudioInputReturnType", inner=(types.Response, ...)) - partial_mdl = create_model("AudioInputPartialReturnType", inner=(partial_types.Response, ...)) + mdl = create_model("AudioInputReturnType", inner=(str, ...)) + partial_mdl = create_model("AudioInputPartialReturnType", inner=(Optional[str], ...)) - return baml_py.BamlStream[partial_types.Response, types.Response]( + return baml_py.BamlStream[Optional[str], str]( raw, lambda x: coerce(partial_mdl, x), lambda x: coerce(mdl, x), diff --git a/integ-tests/python/baml_client/inlinedbaml.py b/integ-tests/python/baml_client/inlinedbaml.py index 4bdde6dd4..9a28553f2 100644 --- a/integ-tests/python/baml_client/inlinedbaml.py +++ b/integ-tests/python/baml_client/inlinedbaml.py @@ -22,14 +22,14 @@ "fiddle-examples/classify-message.baml": "// This will be available as an enum in your Python and Typescript code.\nenum Category {\n Refund\n CancelOrder\n TechnicalSupport\n AccountIssue\n Question\n}\n\nfunction ClassifyMessage(input: string) -> Category {\n client GPT4\n\n prompt #\"\n Classify the following INPUT into ONE\n of the following categories:\n\n INPUT: {{ input }}\n\n {{ ctx.output_format }}\n\n Response:\n \"#\n}", "fiddle-examples/extract-names.baml": "function ExtractNames(input: string) -> string[] {\n client GPT4\n prompt #\"\n Extract the names from this INPUT:\n \n INPUT:\n ---\n {{ input }}\n ---\n\n {{ ctx.output_format }}\n\n Response:\n \"#\n}\n", "fiddle-examples/extract-receipt-info.baml": "class ReceiptItem {\n name string\n description string?\n quantity int\n price float\n}\n\nclass ReceiptInfo {\n items ReceiptItem[]\n total_cost float?\n}\n\nfunction ExtractReceiptInfo(email: string) -> ReceiptInfo {\n client GPT4o\n prompt #\"\n Given the receipt below:\n\n ```\n {{email}}\n ```\n\n {{ ctx.output_format }}\n \"#\n}\n\n", - "fiddle-examples/images/image.baml": "function DescribeImage(img: image) -> string {\n client AwsBedrock\n prompt #\"\n {{ _.role(\"user\") }}\n\n\n Describe the image below in 20 words:\n {{ img }}\n \"#\n\n}\n\nclass FakeImage {\n url string\n}\n\nclass ClassWithImage {\n myImage image\n param2 string\n fake_image FakeImage\n}\n\n// chat role user present\nfunction DescribeImage2(classWithImage: ClassWithImage, img2: image) -> string {\n client GPT4Turbo\n prompt #\"\n {{ _.role(\"user\") }}\n You should return 2 answers that answer the following commands.\n\n 1. Describe this in 5 words:\n {{ classWithImage.myImage }}\n\n 2. Also tell me what's happening here in one sentence:\n {{ img2 }}\n \"#\n}\n\n// no chat role\nfunction DescribeImage3(classWithImage: ClassWithImage, img2: image) -> string {\n client GPT4Turbo\n prompt #\"\n Describe this in 5 words:\n {{ classWithImage.myImage }}\n\n Tell me also what's happening here in one sentence and relate it to the word {{ classWithImage.param2 }}:\n {{ img2 }}\n \"#\n}\n\n\n// system prompt and chat prompt\nfunction DescribeImage4(classWithImage: ClassWithImage, img2: image) -> string {\n client GPT4Turbo\n prompt #\"\n {{ _.role(\"system\")}}\n\n Describe this in 5 words:\n {{ classWithImage.myImage }}\n\n Tell me also what's happening here in one sentence and relate it to the word {{ classWithImage.param2 }}:\n {{ img2 }}\n \"#\n}\n\ntest TestName {\n functions [DescribeImage]\n args {\n img { url \"http://imgs.xkcd.com/comics/standards.png\" }\n }\n}\n", + "fiddle-examples/images/image.baml": "function DescribeImage(img: image) -> string {\n client AwsBedrock\n prompt #\"\n {{ _.role(\"user\") }}\n\n\n Describe the image below in 20 words:\n {{ img }}\n \"#\n\n}\n\nclass FakeImage {\n url string\n}\n\nclass ClassWithImage {\n myImage image\n param2 string\n fake_image FakeImage\n}\n\n// chat role user present\nfunction DescribeImage2(classWithImage: ClassWithImage, img2: image) -> string { \n client GPT4Turbo\n prompt #\"\n {{ _.role(\"user\") }}\n You should return 2 answers that answer the following commands.\n\n 1. Describe this in 5 words:\n {{ classWithImage.myImage }}\n\n 2. Also tell me what's happening here in one sentence:\n {{ img2 }}\n \"#\n}\n\n// no chat role\nfunction DescribeImage3(classWithImage: ClassWithImage, img2: image) -> string {\n client GPT4Turbo\n prompt #\"\n Describe this in 5 words:\n {{ classWithImage.myImage }}\n\n Tell me also what's happening here in one sentence and relate it to the word {{ classWithImage.param2 }}:\n {{ img2 }}\n \"#\n}\n\n\n// system prompt and chat prompt\nfunction DescribeImage4(classWithImage: ClassWithImage, img2: image) -> string {\n client GPT4Turbo\n prompt #\"\n {{ _.role(\"system\")}}\n\n Describe this in 5 words:\n {{ classWithImage.myImage }}\n\n Tell me also what's happening here in one sentence and relate it to the word {{ classWithImage.param2 }}:\n {{ img2 }}\n \"#\n}\n\ntest TestName {\n functions [DescribeImage]\n args {\n img { url \"https://imgs.xkcd.com/comics/standards.png\"}\n }\n}\n", "fiddle-examples/symbol-tuning.baml": "enum Category3 {\n Refund @alias(\"k1\")\n @description(\"Customer wants to refund a product\")\n\n CancelOrder @alias(\"k2\")\n @description(\"Customer wants to cancel an order\")\n\n TechnicalSupport @alias(\"k3\")\n @description(\"Customer needs help with a technical issue unrelated to account creation or login\")\n\n AccountIssue @alias(\"k4\")\n @description(\"Specifically relates to account-login or account-creation\")\n\n Question @alias(\"k5\")\n @description(\"Customer has a question\")\n}\n\nfunction ClassifyMessage3(input: string) -> Category {\n client GPT4\n\n prompt #\"\n Classify the following INPUT into ONE\n of the following categories:\n\n INPUT: {{ input }}\n\n {{ ctx.output_format }}\n\n Response:\n \"#\n}", "main.baml": "generator lang_python {\n output_type python/pydantic\n output_dir \"../python\"\n}\n\ngenerator lang_typescript {\n output_type typescript\n output_dir \"../typescript\"\n}\n\ngenerator lang_ruby {\n output_type ruby/sorbet\n output_dir \"../ruby\"\n}\n", "test-files/aliases/classes.baml": "class TestClassAlias {\n key string @alias(\"key-dash\") @description(#\"\n This is a description for key\n af asdf\n \"#)\n key2 string @alias(\"key21\")\n key3 string @alias(\"key with space\")\n key4 string //unaliased\n key5 string @alias(\"key.with.punctuation/123\")\n}\n\nfunction FnTestClassAlias(input: string) -> TestClassAlias {\n client GPT35\n prompt #\"\n {{ctx.output_format}}\n \"#\n}\n\ntest FnTestClassAlias {\n functions [FnTestClassAlias]\n args {\n input \"example input\"\n }\n}\n", "test-files/aliases/enums.baml": "enum TestEnum {\n A @alias(\"k1\") @description(#\"\n User is angry\n \"#)\n B @alias(\"k22\") @description(#\"\n User is happy\n \"#)\n // tests whether k1 doesnt incorrectly get matched with k11\n C @alias(\"k11\") @description(#\"\n User is sad\n \"#)\n D @alias(\"k44\") @description(\n User is confused\n )\n E @description(\n User is excited\n )\n F @alias(\"k5\") // only alias\n \n G @alias(\"k6\") @description(#\"\n User is bored\n With a long description\n \"#)\n \n @@alias(\"Category\")\n}\n\nfunction FnTestAliasedEnumOutput(input: string) -> TestEnum {\n client GPT35\n prompt #\"\n Classify the user input into the following category\n \n {{ ctx.output_format }}\n\n {{ _.role('user') }}\n {{input}}\n\n {{ _.role('assistant') }}\n Category ID:\n \"#\n}\n\ntest FnTestAliasedEnumOutput {\n functions [FnTestAliasedEnumOutput]\n args {\n input \"mehhhhh\"\n }\n}", "test-files/comments/comments.baml": "// add some functions, classes, enums etc with comments all over.", "test-files/dynamic/dynamic.baml": "class DynamicClassOne {\n @@dynamic\n}\n\nenum DynEnumOne {\n @@dynamic\n}\n\nenum DynEnumTwo {\n @@dynamic\n}\n\nclass SomeClassNestedDynamic {\n hi string\n @@dynamic\n\n}\n\nclass DynamicClassTwo {\n hi string\n some_class SomeClassNestedDynamic\n status DynEnumOne\n @@dynamic\n}\n\nfunction DynamicFunc(input: DynamicClassOne) -> DynamicClassTwo {\n client GPT35\n prompt #\"\n Please extract the schema from \n {{ input }}\n\n {{ ctx.output_format }}\n \"#\n}\n\nclass DynInputOutput {\n testKey string\n @@dynamic\n}\n\nfunction DynamicInputOutput(input: DynInputOutput) -> DynInputOutput {\n client GPT35\n prompt #\"\n Here is some input data:\n ----\n {{ input }}\n ----\n\n Extract the information.\n {{ ctx.output_format }}\n \"#\n}\n\nfunction DynamicListInputOutput(input: DynInputOutput[]) -> DynInputOutput[] {\n client GPT35\n prompt #\"\n Here is some input data:\n ----\n {{ input }}\n ----\n\n Extract the information.\n {{ ctx.output_format }}\n \"#\n}\n\n\n\nclass DynamicOutput {\n @@dynamic\n}\n \nfunction MyFunc(input: string) -> DynamicOutput {\n client GPT35\n prompt #\"\n Given a string, extract info using the schema:\n\n {{ input}}\n\n {{ ctx.output_format }}\n \"#\n}\n\n", - "test-files/functions/input/named-args/single/named-audio.baml": "class Response {\n type string\n reason string\n appropriate_for_video_games bool\n score int @description(#\"\n 1-5, 1 being best at video game background music and 5 being worst\n \"#)\n}\n\nfunction AudioInput(aud: audio) -> Response {\n client Gemini\n prompt #\"\n Describe the sound.\n\n {{ ctx.output_format(prefix=\"Answer in this schema:\\n\") }}\n\n\n {{ _.role(\"user\") }}\n \n {{ aud }}\n \"#\n}\n\n\ntest TestURLAudioInput{\n functions [AudioInput]\n args {\n aud{ \n url https://actions.google.com/sounds/v1/emergency/beeper_emergency_call.ogg\n }\n } \n}\n\n\n", + "test-files/functions/input/named-args/single/named-audio.baml": "function AudioInput(aud: audio) -> string{\n client Gemini\n prompt #\"\n {{ _.role(\"user\") }}\n\n Does this sound like a roar? Yes or no? One word no other characters.\n \n {{ aud }}\n \"#\n}\n\n\ntest TestURLAudioInput{\n functions [AudioInput]\n args {\n aud{ \n url https://actions.google.com/sounds/v1/emergency/beeper_emergency_call.ogg\n }\n } \n}\n\n\n", "test-files/functions/input/named-args/single/named-boolean.baml": "\n\nfunction TestFnNamedArgsSingleBool(myBool: bool) -> string{\n client GPT35\n prompt #\"\n Return this value back to me: {{myBool}}\n \"#\n}\n\ntest TestFnNamedArgsSingleBool {\n functions [TestFnNamedArgsSingleBool]\n args {\n myBool true\n }\n}", "test-files/functions/input/named-args/single/named-class-list.baml": "\n\n\nfunction TestFnNamedArgsSingleStringList(myArg: string[]) -> string{\n client GPT35\n prompt #\"\n Return this value back to me: {{myArg}}\n \"#\n}\n\ntest TestFnNamedArgsSingleStringList {\n functions [TestFnNamedArgsSingleStringList]\n args {\n myArg [\"hello\", \"world\"]\n }\n}", "test-files/functions/input/named-args/single/named-class.baml": "class NamedArgsSingleClass {\n key string\n key_two bool\n key_three int\n // TODO: doesn't work with keys with numbers\n // key2 bool\n // key3 int\n}\n\nfunction TestFnNamedArgsSingleClass(myArg: NamedArgsSingleClass) -> string {\n client GPT35\n prompt #\"\n Print these values back to me:\n {{myArg.key}}\n {{myArg.key_two}}\n {{myArg.key_three}}\n \"#\n}\n\ntest TestFnNamedArgsSingleClass {\n functions [TestFnNamedArgsSingleClass]\n args {\n myArg {\n key \"example\",\n key_two true,\n key_three 42\n }\n }\n}\n\nfunction TestMulticlassNamedArgs(myArg: NamedArgsSingleClass, myArg2: NamedArgsSingleClass) -> string {\n client GPT35\n prompt #\"\n Print these values back to me:\n {{myArg.key}}\n {{myArg.key_two}}\n {{myArg.key_three}}\n {{myArg2.key}}\n {{myArg2.key_two}}\n {{myArg2.key_three}}\n \"#\n}", @@ -64,8 +64,8 @@ "test-files/strategies/fallback.baml": "\nclient FaultyClient {\n provider openai\n options {\n model unknown-model\n api_key env.OPENAI_API_KEY\n }\n}\n\n\nclient FallbackClient {\n provider fallback\n options {\n // first 2 clients are expected to fail.\n strategy [\n FaultyClient,\n RetryClientConstant,\n GPT35\n ]\n }\n}\n\nfunction TestFallbackClient() -> string {\n client FallbackClient\n // TODO make it return the client name instead\n prompt #\"\n Say a haiku about mexico.\n \"#\n}", "test-files/strategies/retry.baml": "\nretry_policy Exponential {\n max_retries 3\n strategy {\n type exponential_backoff\n }\n}\n\nretry_policy Constant {\n max_retries 3\n strategy {\n type constant_delay\n delay_ms 100\n }\n}\n\nclient RetryClientConstant {\n provider openai\n retry_policy Constant\n options {\n model \"gpt-3.5-turbo\"\n api_key \"blah\"\n }\n}\n\nclient RetryClientExponential {\n provider openai\n retry_policy Exponential\n options {\n model \"gpt-3.5-turbo\"\n api_key \"blahh\"\n }\n}\n\nfunction TestRetryConstant() -> string {\n client RetryClientConstant\n prompt #\"\n Say a haiku\n \"#\n}\n\nfunction TestRetryExponential() -> string {\n client RetryClientExponential\n prompt #\"\n Say a haiku\n \"#\n}\n", "test-files/strategies/roundrobin.baml": "", - "test-files/testing_pipeline/resume.baml": "class Resume {\n name string\n email string\n phone string\n experience string[]\n education Education[]\n skills string[]\n}\n\nclass Education {\n institution string\n location string\n degree string\n major string[]\n date string? @alias(start_date) @description(#\"\n YYYY-MM\n \"#)\n}\n\ntemplate_string AddRole(foo: string) #\"\n {{ _.role('system')}}\n You are a {{ foo }}. be nice\n\n {{ _.role('user') }}\n\"#\n\nfunction ExtractResume(resume: string, img: image?) -> Resume {\n client GPT35\n prompt #\"\n {{ AddRole(\"Software Engineer\") }}\n\n Extract data:\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 input {\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 input {\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}", + "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\nfunction ExtractResume(resume: string, img: image?) -> Resume {\n client GPT35\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 input {\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 input {\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}", } def get_baml_files(): - return file_map + return file_map \ No newline at end of file diff --git a/integ-tests/python/baml_client/partial_types.py b/integ-tests/python/baml_client/partial_types.py index 86acfffef..350ac21ab 100644 --- a/integ-tests/python/baml_client/partial_types.py +++ b/integ-tests/python/baml_client/partial_types.py @@ -84,7 +84,7 @@ class Education(BaseModel): location: Optional[str] = None degree: Optional[str] = None major: List[Optional[str]] - date: Optional[str] = None + graduation_date: Optional[str] = None class Email(BaseModel): @@ -173,22 +173,14 @@ class ReceiptItem(BaseModel): quantity: Optional[int] = None price: Optional[float] = None -class Response(BaseModel): - - - type: Optional[str] = None - reason: Optional[str] = None - appropriate_for_video_games: Optional[bool] = None - score: Optional[int] = None - class Resume(BaseModel): name: Optional[str] = None email: Optional[str] = None phone: Optional[str] = None - experience: List[Optional[str]] - education: List["Education"] + experience: List["Education"] + education: List[Optional[str]] skills: List[Optional[str]] class SearchParams(BaseModel): diff --git a/integ-tests/python/baml_client/type_builder.py b/integ-tests/python/baml_client/type_builder.py index 1af3b7ecc..54d4fb68f 100644 --- a/integ-tests/python/baml_client/type_builder.py +++ b/integ-tests/python/baml_client/type_builder.py @@ -19,7 +19,7 @@ class TypeBuilder(_TypeBuilder): def __init__(self): super().__init__(classes=set( - ["Blah","ClassOptionalOutput","ClassOptionalOutput2","ClassWithImage","DynInputOutput","DynamicClassOne","DynamicClassTwo","DynamicOutput","Education","Email","Event","FakeImage","InnerClass","InnerClass2","NamedArgsSingleClass","OptionalTest_Prop1","OptionalTest_ReturnType","OrderInfo","Person","RaysData","ReceiptInfo","ReceiptItem","Response","Resume","SearchParams","SomeClassNestedDynamic","TestClassAlias","TestClassNested","TestClassWithEnum","TestOutputClass","UnionTest_ReturnType","WithReasoning",] + ["Blah","ClassOptionalOutput","ClassOptionalOutput2","ClassWithImage","DynInputOutput","DynamicClassOne","DynamicClassTwo","DynamicOutput","Education","Email","Event","FakeImage","InnerClass","InnerClass2","NamedArgsSingleClass","OptionalTest_Prop1","OptionalTest_ReturnType","OrderInfo","Person","RaysData","ReceiptInfo","ReceiptItem","Resume","SearchParams","SomeClassNestedDynamic","TestClassAlias","TestClassNested","TestClassWithEnum","TestOutputClass","UnionTest_ReturnType","WithReasoning",] ), enums=set( ["Category","Category2","Category3","Color","DataType","DynEnumOne","DynEnumTwo","EnumInClass","EnumOutput","Hobby","NamedArgsSingleEnum","NamedArgsSingleEnumList","OptionalTest_CategoryType","OrderStatus","Tag","TestEnum",] )) diff --git a/integ-tests/python/baml_client/types.py b/integ-tests/python/baml_client/types.py index 9b7cf9c85..418ecd539 100644 --- a/integ-tests/python/baml_client/types.py +++ b/integ-tests/python/baml_client/types.py @@ -175,7 +175,7 @@ class Education(BaseModel): location: str degree: str major: List[str] - date: Optional[str] = None + graduation_date: Optional[str] = None class Email(BaseModel): @@ -264,22 +264,14 @@ class ReceiptItem(BaseModel): quantity: int price: float -class Response(BaseModel): - - - type: str - reason: str - appropriate_for_video_games: bool - score: int - class Resume(BaseModel): name: str email: str phone: str - experience: List[str] - education: List["Education"] + experience: List["Education"] + education: List[str] skills: List[str] class SearchParams(BaseModel): diff --git a/integ-tests/ruby/baml_client/client.rb b/integ-tests/ruby/baml_client/client.rb index 1c4568f95..9de2dbe2e 100644 --- a/integ-tests/ruby/baml_client/client.rb +++ b/integ-tests/ruby/baml_client/client.rb @@ -53,7 +53,7 @@ def self.from_directory(path) params( aud: Baml::Audio, - ).returns(Baml::Types::Response) + ).returns(String) } def AudioInput( @@ -1299,7 +1299,7 @@ def initialize(runtime:, ctx_manager:) sig { params( aud: Baml::Audio, - ).returns(Baml::BamlStream[Baml::Types::Response]) + ).returns(Baml::BamlStream[String]) } def AudioInput( aud: @@ -1311,7 +1311,7 @@ def AudioInput( }, @ctx_manager, ) - Baml::BamlStream[Baml::PartialTypes::Response, Baml::Types::Response].new( + Baml::BamlStream[T.nilable(String), String].new( ffi_stream: raw, ctx_manager: @ctx_manager ) diff --git a/integ-tests/ruby/baml_client/inlined.rb b/integ-tests/ruby/baml_client/inlined.rb index b6a01c168..6a6545ff2 100644 --- a/integ-tests/ruby/baml_client/inlined.rb +++ b/integ-tests/ruby/baml_client/inlined.rb @@ -22,14 +22,14 @@ module Inlined "fiddle-examples/classify-message.baml" => "// This will be available as an enum in your Python and Typescript code.\nenum Category {\n Refund\n CancelOrder\n TechnicalSupport\n AccountIssue\n Question\n}\n\nfunction ClassifyMessage(input: string) -> Category {\n client GPT4\n\n prompt #\"\n Classify the following INPUT into ONE\n of the following categories:\n\n INPUT: {{ input }}\n\n {{ ctx.output_format }}\n\n Response:\n \"#\n}", "fiddle-examples/extract-names.baml" => "function ExtractNames(input: string) -> string[] {\n client GPT4\n prompt #\"\n Extract the names from this INPUT:\n \n INPUT:\n ---\n {{ input }}\n ---\n\n {{ ctx.output_format }}\n\n Response:\n \"#\n}\n", "fiddle-examples/extract-receipt-info.baml" => "class ReceiptItem {\n name string\n description string?\n quantity int\n price float\n}\n\nclass ReceiptInfo {\n items ReceiptItem[]\n total_cost float?\n}\n\nfunction ExtractReceiptInfo(email: string) -> ReceiptInfo {\n client GPT4o\n prompt #\"\n Given the receipt below:\n\n ```\n {{email}}\n ```\n\n {{ ctx.output_format }}\n \"#\n}\n\n", - "fiddle-examples/images/image.baml" => "function DescribeImage(img: image) -> string {\n client AwsBedrock\n prompt #\"\n {{ _.role(\"user\") }}\n\n\n Describe the image below in 20 words:\n {{ img }}\n \"#\n\n}\n\nclass FakeImage {\n url string\n}\n\nclass ClassWithImage {\n myImage image\n param2 string\n fake_image FakeImage\n}\n\n// chat role user present\nfunction DescribeImage2(classWithImage: ClassWithImage, img2: image) -> string {\n client GPT4Turbo\n prompt #\"\n {{ _.role(\"user\") }}\n You should return 2 answers that answer the following commands.\n\n 1. Describe this in 5 words:\n {{ classWithImage.myImage }}\n\n 2. Also tell me what's happening here in one sentence:\n {{ img2 }}\n \"#\n}\n\n// no chat role\nfunction DescribeImage3(classWithImage: ClassWithImage, img2: image) -> string {\n client GPT4Turbo\n prompt #\"\n Describe this in 5 words:\n {{ classWithImage.myImage }}\n\n Tell me also what's happening here in one sentence and relate it to the word {{ classWithImage.param2 }}:\n {{ img2 }}\n \"#\n}\n\n\n// system prompt and chat prompt\nfunction DescribeImage4(classWithImage: ClassWithImage, img2: image) -> string {\n client GPT4Turbo\n prompt #\"\n {{ _.role(\"system\")}}\n\n Describe this in 5 words:\n {{ classWithImage.myImage }}\n\n Tell me also what's happening here in one sentence and relate it to the word {{ classWithImage.param2 }}:\n {{ img2 }}\n \"#\n}\n\ntest TestName {\n functions [DescribeImage]\n args {\n img { url \"http://imgs.xkcd.com/comics/standards.png\" }\n }\n}\n", + "fiddle-examples/images/image.baml" => "function DescribeImage(img: image) -> string {\n client AwsBedrock\n prompt #\"\n {{ _.role(\"user\") }}\n\n\n Describe the image below in 20 words:\n {{ img }}\n \"#\n\n}\n\nclass FakeImage {\n url string\n}\n\nclass ClassWithImage {\n myImage image\n param2 string\n fake_image FakeImage\n}\n\n// chat role user present\nfunction DescribeImage2(classWithImage: ClassWithImage, img2: image) -> string { \n client GPT4Turbo\n prompt #\"\n {{ _.role(\"user\") }}\n You should return 2 answers that answer the following commands.\n\n 1. Describe this in 5 words:\n {{ classWithImage.myImage }}\n\n 2. Also tell me what's happening here in one sentence:\n {{ img2 }}\n \"#\n}\n\n// no chat role\nfunction DescribeImage3(classWithImage: ClassWithImage, img2: image) -> string {\n client GPT4Turbo\n prompt #\"\n Describe this in 5 words:\n {{ classWithImage.myImage }}\n\n Tell me also what's happening here in one sentence and relate it to the word {{ classWithImage.param2 }}:\n {{ img2 }}\n \"#\n}\n\n\n// system prompt and chat prompt\nfunction DescribeImage4(classWithImage: ClassWithImage, img2: image) -> string {\n client GPT4Turbo\n prompt #\"\n {{ _.role(\"system\")}}\n\n Describe this in 5 words:\n {{ classWithImage.myImage }}\n\n Tell me also what's happening here in one sentence and relate it to the word {{ classWithImage.param2 }}:\n {{ img2 }}\n \"#\n}\n\ntest TestName {\n functions [DescribeImage]\n args {\n img { url \"https://imgs.xkcd.com/comics/standards.png\"}\n }\n}\n", "fiddle-examples/symbol-tuning.baml" => "enum Category3 {\n Refund @alias(\"k1\")\n @description(\"Customer wants to refund a product\")\n\n CancelOrder @alias(\"k2\")\n @description(\"Customer wants to cancel an order\")\n\n TechnicalSupport @alias(\"k3\")\n @description(\"Customer needs help with a technical issue unrelated to account creation or login\")\n\n AccountIssue @alias(\"k4\")\n @description(\"Specifically relates to account-login or account-creation\")\n\n Question @alias(\"k5\")\n @description(\"Customer has a question\")\n}\n\nfunction ClassifyMessage3(input: string) -> Category {\n client GPT4\n\n prompt #\"\n Classify the following INPUT into ONE\n of the following categories:\n\n INPUT: {{ input }}\n\n {{ ctx.output_format }}\n\n Response:\n \"#\n}", "main.baml" => "generator lang_python {\n output_type python/pydantic\n output_dir \"../python\"\n}\n\ngenerator lang_typescript {\n output_type typescript\n output_dir \"../typescript\"\n}\n\ngenerator lang_ruby {\n output_type ruby/sorbet\n output_dir \"../ruby\"\n}\n", "test-files/aliases/classes.baml" => "class TestClassAlias {\n key string @alias(\"key-dash\") @description(#\"\n This is a description for key\n af asdf\n \"#)\n key2 string @alias(\"key21\")\n key3 string @alias(\"key with space\")\n key4 string //unaliased\n key5 string @alias(\"key.with.punctuation/123\")\n}\n\nfunction FnTestClassAlias(input: string) -> TestClassAlias {\n client GPT35\n prompt #\"\n {{ctx.output_format}}\n \"#\n}\n\ntest FnTestClassAlias {\n functions [FnTestClassAlias]\n args {\n input \"example input\"\n }\n}\n", "test-files/aliases/enums.baml" => "enum TestEnum {\n A @alias(\"k1\") @description(#\"\n User is angry\n \"#)\n B @alias(\"k22\") @description(#\"\n User is happy\n \"#)\n // tests whether k1 doesnt incorrectly get matched with k11\n C @alias(\"k11\") @description(#\"\n User is sad\n \"#)\n D @alias(\"k44\") @description(\n User is confused\n )\n E @description(\n User is excited\n )\n F @alias(\"k5\") // only alias\n \n G @alias(\"k6\") @description(#\"\n User is bored\n With a long description\n \"#)\n \n @@alias(\"Category\")\n}\n\nfunction FnTestAliasedEnumOutput(input: string) -> TestEnum {\n client GPT35\n prompt #\"\n Classify the user input into the following category\n \n {{ ctx.output_format }}\n\n {{ _.role('user') }}\n {{input}}\n\n {{ _.role('assistant') }}\n Category ID:\n \"#\n}\n\ntest FnTestAliasedEnumOutput {\n functions [FnTestAliasedEnumOutput]\n args {\n input \"mehhhhh\"\n }\n}", "test-files/comments/comments.baml" => "// add some functions, classes, enums etc with comments all over.", "test-files/dynamic/dynamic.baml" => "class DynamicClassOne {\n @@dynamic\n}\n\nenum DynEnumOne {\n @@dynamic\n}\n\nenum DynEnumTwo {\n @@dynamic\n}\n\nclass SomeClassNestedDynamic {\n hi string\n @@dynamic\n\n}\n\nclass DynamicClassTwo {\n hi string\n some_class SomeClassNestedDynamic\n status DynEnumOne\n @@dynamic\n}\n\nfunction DynamicFunc(input: DynamicClassOne) -> DynamicClassTwo {\n client GPT35\n prompt #\"\n Please extract the schema from \n {{ input }}\n\n {{ ctx.output_format }}\n \"#\n}\n\nclass DynInputOutput {\n testKey string\n @@dynamic\n}\n\nfunction DynamicInputOutput(input: DynInputOutput) -> DynInputOutput {\n client GPT35\n prompt #\"\n Here is some input data:\n ----\n {{ input }}\n ----\n\n Extract the information.\n {{ ctx.output_format }}\n \"#\n}\n\nfunction DynamicListInputOutput(input: DynInputOutput[]) -> DynInputOutput[] {\n client GPT35\n prompt #\"\n Here is some input data:\n ----\n {{ input }}\n ----\n\n Extract the information.\n {{ ctx.output_format }}\n \"#\n}\n\n\n\nclass DynamicOutput {\n @@dynamic\n}\n \nfunction MyFunc(input: string) -> DynamicOutput {\n client GPT35\n prompt #\"\n Given a string, extract info using the schema:\n\n {{ input}}\n\n {{ ctx.output_format }}\n \"#\n}\n\n", - "test-files/functions/input/named-args/single/named-audio.baml" => "class Response {\n type string\n reason string\n appropriate_for_video_games bool\n score int @description(#\"\n 1-5, 1 being best at video game background music and 5 being worst\n \"#)\n}\n\nfunction AudioInput(aud: audio) -> Response {\n client Gemini\n prompt #\"\n Describe the sound.\n\n {{ ctx.output_format(prefix=\"Answer in this schema:\\n\") }}\n\n\n {{ _.role(\"user\") }}\n \n {{ aud }}\n \"#\n}\n\n\ntest TestURLAudioInput{\n functions [AudioInput]\n args {\n aud{ \n url https://actions.google.com/sounds/v1/emergency/beeper_emergency_call.ogg\n }\n } \n}\n\n\n", + "test-files/functions/input/named-args/single/named-audio.baml" => "function AudioInput(aud: audio) -> string{\n client Gemini\n prompt #\"\n {{ _.role(\"user\") }}\n\n Does this sound like a roar? Yes or no? One word no other characters.\n \n {{ aud }}\n \"#\n}\n\n\ntest TestURLAudioInput{\n functions [AudioInput]\n args {\n aud{ \n url https://actions.google.com/sounds/v1/emergency/beeper_emergency_call.ogg\n }\n } \n}\n\n\n", "test-files/functions/input/named-args/single/named-boolean.baml" => "\n\nfunction TestFnNamedArgsSingleBool(myBool: bool) -> string{\n client GPT35\n prompt #\"\n Return this value back to me: {{myBool}}\n \"#\n}\n\ntest TestFnNamedArgsSingleBool {\n functions [TestFnNamedArgsSingleBool]\n args {\n myBool true\n }\n}", "test-files/functions/input/named-args/single/named-class-list.baml" => "\n\n\nfunction TestFnNamedArgsSingleStringList(myArg: string[]) -> string{\n client GPT35\n prompt #\"\n Return this value back to me: {{myArg}}\n \"#\n}\n\ntest TestFnNamedArgsSingleStringList {\n functions [TestFnNamedArgsSingleStringList]\n args {\n myArg [\"hello\", \"world\"]\n }\n}", "test-files/functions/input/named-args/single/named-class.baml" => "class NamedArgsSingleClass {\n key string\n key_two bool\n key_three int\n // TODO: doesn't work with keys with numbers\n // key2 bool\n // key3 int\n}\n\nfunction TestFnNamedArgsSingleClass(myArg: NamedArgsSingleClass) -> string {\n client GPT35\n prompt #\"\n Print these values back to me:\n {{myArg.key}}\n {{myArg.key_two}}\n {{myArg.key_three}}\n \"#\n}\n\ntest TestFnNamedArgsSingleClass {\n functions [TestFnNamedArgsSingleClass]\n args {\n myArg {\n key \"example\",\n key_two true,\n key_three 42\n }\n }\n}\n\nfunction TestMulticlassNamedArgs(myArg: NamedArgsSingleClass, myArg2: NamedArgsSingleClass) -> string {\n client GPT35\n prompt #\"\n Print these values back to me:\n {{myArg.key}}\n {{myArg.key_two}}\n {{myArg.key_three}}\n {{myArg2.key}}\n {{myArg2.key_two}}\n {{myArg2.key_three}}\n \"#\n}", @@ -64,7 +64,7 @@ module Inlined "test-files/strategies/fallback.baml" => "\nclient FaultyClient {\n provider openai\n options {\n model unknown-model\n api_key env.OPENAI_API_KEY\n }\n}\n\n\nclient FallbackClient {\n provider fallback\n options {\n // first 2 clients are expected to fail.\n strategy [\n FaultyClient,\n RetryClientConstant,\n GPT35\n ]\n }\n}\n\nfunction TestFallbackClient() -> string {\n client FallbackClient\n // TODO make it return the client name instead\n prompt #\"\n Say a haiku about mexico.\n \"#\n}", "test-files/strategies/retry.baml" => "\nretry_policy Exponential {\n max_retries 3\n strategy {\n type exponential_backoff\n }\n}\n\nretry_policy Constant {\n max_retries 3\n strategy {\n type constant_delay\n delay_ms 100\n }\n}\n\nclient RetryClientConstant {\n provider openai\n retry_policy Constant\n options {\n model \"gpt-3.5-turbo\"\n api_key \"blah\"\n }\n}\n\nclient RetryClientExponential {\n provider openai\n retry_policy Exponential\n options {\n model \"gpt-3.5-turbo\"\n api_key \"blahh\"\n }\n}\n\nfunction TestRetryConstant() -> string {\n client RetryClientConstant\n prompt #\"\n Say a haiku\n \"#\n}\n\nfunction TestRetryExponential() -> string {\n client RetryClientExponential\n prompt #\"\n Say a haiku\n \"#\n}\n", "test-files/strategies/roundrobin.baml" => "", - "test-files/testing_pipeline/resume.baml" => "class Resume {\n name string\n email string\n phone string\n experience string[]\n education Education[]\n skills string[]\n}\n\nclass Education {\n institution string\n location string\n degree string\n major string[]\n date string? @alias(start_date) @description(#\"\n YYYY-MM\n \"#)\n}\n\ntemplate_string AddRole(foo: string) #\"\n {{ _.role('system')}}\n You are a {{ foo }}. be nice\n\n {{ _.role('user') }}\n\"#\n\nfunction ExtractResume(resume: string, img: image?) -> Resume {\n client GPT35\n prompt #\"\n {{ AddRole(\"Software Engineer\") }}\n\n Extract data:\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 input {\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 input {\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}", + "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\nfunction ExtractResume(resume: string, img: image?) -> Resume {\n client GPT35\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 input {\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 input {\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}", } end end \ No newline at end of file diff --git a/integ-tests/ruby/baml_client/partial-types.rb b/integ-tests/ruby/baml_client/partial-types.rb index ec3d79881..e80d0cfde 100644 --- a/integ-tests/ruby/baml_client/partial-types.rb +++ b/integ-tests/ruby/baml_client/partial-types.rb @@ -43,7 +43,6 @@ class Person < T::Struct; end class RaysData < T::Struct; end class ReceiptInfo < T::Struct; end class ReceiptItem < T::Struct; end - class Response < T::Struct; end class Resume < T::Struct; end class SearchParams < T::Struct; end class SomeClassNestedDynamic < T::Struct; end @@ -96,7 +95,7 @@ class Education < T::Struct const :location, T.nilable(String) const :degree, T.nilable(String) const :major, T::Array[T.nilable(String)] - const :date, T.nilable(String) + const :graduation_date, T.nilable(String) end class Email < T::Struct include T::Struct::ActsAsComparable @@ -171,20 +170,13 @@ class ReceiptItem < T::Struct const :quantity, T.nilable(Integer) const :price, T.nilable(Float) end - class Response < T::Struct - include T::Struct::ActsAsComparable - const :type, T.nilable(String) - const :reason, T.nilable(String) - const :appropriate_for_video_games, T.nilable(T::Boolean) - const :score, T.nilable(Integer) - end class Resume < T::Struct include T::Struct::ActsAsComparable const :name, T.nilable(String) const :email, T.nilable(String) const :phone, T.nilable(String) - const :experience, T::Array[T.nilable(String)] - const :education, T::Array[Baml::PartialTypes::Education] + const :experience, T::Array[Baml::PartialTypes::Education] + const :education, T::Array[T.nilable(String)] const :skills, T::Array[T.nilable(String)] end class SearchParams < T::Struct diff --git a/integ-tests/ruby/baml_client/types.rb b/integ-tests/ruby/baml_client/types.rb index 13f9b2fbd..284546a38 100644 --- a/integ-tests/ruby/baml_client/types.rb +++ b/integ-tests/ruby/baml_client/types.rb @@ -153,7 +153,6 @@ class Person < T::Struct; end class RaysData < T::Struct; end class ReceiptInfo < T::Struct; end class ReceiptItem < T::Struct; end - class Response < T::Struct; end class Resume < T::Struct; end class SearchParams < T::Struct; end class SomeClassNestedDynamic < T::Struct; end @@ -206,7 +205,7 @@ class Education < T::Struct const :location, String const :degree, String const :major, T::Array[String] - const :date, T.nilable(String) + const :graduation_date, T.nilable(String) end class Email < T::Struct include T::Struct::ActsAsComparable @@ -281,20 +280,13 @@ class ReceiptItem < T::Struct const :quantity, Integer const :price, Float end - class Response < T::Struct - include T::Struct::ActsAsComparable - const :type, String - const :reason, String - const :appropriate_for_video_games, T::Boolean - const :score, Integer - end class Resume < T::Struct include T::Struct::ActsAsComparable const :name, String const :email, String const :phone, String - const :experience, T::Array[String] - const :education, T::Array[Baml::Types::Education] + const :experience, T::Array[Baml::Types::Education] + const :education, T::Array[String] const :skills, T::Array[String] end class SearchParams < T::Struct diff --git a/integ-tests/typescript/baml_client/client.ts b/integ-tests/typescript/baml_client/client.ts index 6dc9581c6..4d777d02b 100644 --- a/integ-tests/typescript/baml_client/client.ts +++ b/integ-tests/typescript/baml_client/client.ts @@ -16,63 +16,14 @@ $ pnpm add @boundaryml/baml // biome-ignore format: autogenerated code /* eslint-disable */ import { BamlRuntime, FunctionResult, BamlCtxManager, BamlStream, Image } from "@boundaryml/baml" -import { - Blah, - ClassOptionalOutput, - ClassOptionalOutput2, - ClassWithImage, - DynInputOutput, - DynamicClassOne, - DynamicClassTwo, - DynamicOutput, - Education, - Email, - Event, - FakeImage, - InnerClass, - InnerClass2, - NamedArgsSingleClass, - OptionalTest_Prop1, - OptionalTest_ReturnType, - OrderInfo, - Person, - RaysData, - ReceiptInfo, - ReceiptItem, - Response, - Resume, - SearchParams, - SomeClassNestedDynamic, - TestClassAlias, - TestClassNested, - TestClassWithEnum, - TestOutputClass, - UnionTest_ReturnType, - WithReasoning, - Category, - Category2, - Category3, - Color, - DataType, - DynEnumOne, - DynEnumTwo, - EnumInClass, - EnumOutput, - Hobby, - NamedArgsSingleEnum, - NamedArgsSingleEnumList, - OptionalTest_CategoryType, - OrderStatus, - Tag, - TestEnum, -} from './types' -import TypeBuilder from './type_builder' +import {Blah, ClassOptionalOutput, ClassOptionalOutput2, ClassWithImage, DynInputOutput, DynamicClassOne, DynamicClassTwo, DynamicOutput, Education, Email, Event, FakeImage, InnerClass, InnerClass2, NamedArgsSingleClass, OptionalTest_Prop1, OptionalTest_ReturnType, OrderInfo, Person, RaysData, ReceiptInfo, ReceiptItem, Resume, SearchParams, SomeClassNestedDynamic, TestClassAlias, TestClassNested, TestClassWithEnum, TestOutputClass, UnionTest_ReturnType, WithReasoning, Category, Category2, Category3, Color, DataType, DynEnumOne, DynEnumTwo, EnumInClass, EnumOutput, Hobby, NamedArgsSingleEnum, NamedArgsSingleEnumList, OptionalTest_CategoryType, OrderStatus, Tag, TestEnum} from "./types" +import TypeBuilder from "./type_builder" export type RecursivePartialNull = T extends object ? { - [P in keyof T]?: RecursivePartialNull + [P in keyof T]?: RecursivePartialNull; } - : T | null + : T | null; export class BamlClient { private runtime: BamlRuntime @@ -87,818 +38,959 @@ export class BamlClient { get stream() { return this.stream_client - } + } - async AudioInput(aud: Audio, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async AudioInput( + aud: Audio, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'AudioInput', + "AudioInput", { - aud: aud, + "aud": aud }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) - return raw.parsed() as Response + return raw.parsed() as string } - - async ClassifyMessage(input: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async ClassifyMessage( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'ClassifyMessage', + "ClassifyMessage", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as Category } - - async ClassifyMessage2(input: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async ClassifyMessage2( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'ClassifyMessage2', + "ClassifyMessage2", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as Category } - - async ClassifyMessage3(input: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async ClassifyMessage3( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'ClassifyMessage3', + "ClassifyMessage3", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as Category } - - async DescribeImage(img: Image, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async DescribeImage( + img: Image, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'DescribeImage', + "DescribeImage", { - img: img, + "img": img }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - + async DescribeImage2( - classWithImage: ClassWithImage, - img2: Image, - __baml_options__?: { tb?: TypeBuilder }, + classWithImage: ClassWithImage,img2: Image, + __baml_options__?: { tb?: TypeBuilder } ): Promise { const raw = await this.runtime.callFunction( - 'DescribeImage2', + "DescribeImage2", { - classWithImage: classWithImage, - img2: img2, + "classWithImage": classWithImage,"img2": img2 }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - + async DescribeImage3( - classWithImage: ClassWithImage, - img2: Image, - __baml_options__?: { tb?: TypeBuilder }, + classWithImage: ClassWithImage,img2: Image, + __baml_options__?: { tb?: TypeBuilder } ): Promise { const raw = await this.runtime.callFunction( - 'DescribeImage3', + "DescribeImage3", { - classWithImage: classWithImage, - img2: img2, + "classWithImage": classWithImage,"img2": img2 }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - + async DescribeImage4( - classWithImage: ClassWithImage, - img2: Image, - __baml_options__?: { tb?: TypeBuilder }, + classWithImage: ClassWithImage,img2: Image, + __baml_options__?: { tb?: TypeBuilder } ): Promise { const raw = await this.runtime.callFunction( - 'DescribeImage4', + "DescribeImage4", { - classWithImage: classWithImage, - img2: img2, + "classWithImage": classWithImage,"img2": img2 }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - - async DynamicFunc(input: DynamicClassOne, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async DynamicFunc( + input: DynamicClassOne, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'DynamicFunc', + "DynamicFunc", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as DynamicClassTwo } - - async DynamicInputOutput(input: DynInputOutput, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async DynamicInputOutput( + input: DynInputOutput, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'DynamicInputOutput', + "DynamicInputOutput", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as DynInputOutput } - + async DynamicListInputOutput( - input: DynInputOutput[], - __baml_options__?: { tb?: TypeBuilder }, + input: DynInputOutput[], + __baml_options__?: { tb?: TypeBuilder } ): Promise { const raw = await this.runtime.callFunction( - 'DynamicListInputOutput', + "DynamicListInputOutput", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as DynInputOutput[] } - - async ExtractNames(input: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async ExtractNames( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'ExtractNames', + "ExtractNames", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string[] } - - async ExtractPeople(text: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async ExtractPeople( + text: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'ExtractPeople', + "ExtractPeople", { - text: text, + "text": text }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as Person[] } - - async ExtractReceiptInfo(email: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async ExtractReceiptInfo( + email: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'ExtractReceiptInfo', + "ExtractReceiptInfo", { - email: email, + "email": email }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as ReceiptInfo } - - async ExtractResume(resume: string, img?: Image | null, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async ExtractResume( + resume: string,img?: Image | null, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { 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(), ) return raw.parsed() as Resume } - - async ExtractResume2(resume: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async ExtractResume2( + resume: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'ExtractResume2', + "ExtractResume2", { - resume: resume, + "resume": resume }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as Resume } - + async FnClassOptionalOutput( - input: string, - __baml_options__?: { tb?: TypeBuilder }, + input: string, + __baml_options__?: { tb?: TypeBuilder } ): Promise { const raw = await this.runtime.callFunction( - 'FnClassOptionalOutput', + "FnClassOptionalOutput", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as ClassOptionalOutput | null } - + async FnClassOptionalOutput2( - input: string, - __baml_options__?: { tb?: TypeBuilder }, + input: string, + __baml_options__?: { tb?: TypeBuilder } ): Promise { const raw = await this.runtime.callFunction( - 'FnClassOptionalOutput2', + "FnClassOptionalOutput2", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as ClassOptionalOutput2 | null } - - async FnEnumListOutput(input: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async FnEnumListOutput( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'FnEnumListOutput', + "FnEnumListOutput", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as EnumOutput[] } - - async FnEnumOutput(input: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async FnEnumOutput( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'FnEnumOutput', + "FnEnumOutput", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as EnumOutput } - + async FnNamedArgsSingleStringOptional( - myString?: string | null, - __baml_options__?: { tb?: TypeBuilder }, + myString?: string | null, + __baml_options__?: { tb?: TypeBuilder } ): Promise { const raw = await this.runtime.callFunction( - 'FnNamedArgsSingleStringOptional', + "FnNamedArgsSingleStringOptional", { - myString: myString ?? null, + "myString": myString?? null }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - - async FnOutputBool(input: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async FnOutputBool( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'FnOutputBool', + "FnOutputBool", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as boolean } - - async FnOutputClass(input: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async FnOutputClass( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'FnOutputClass', + "FnOutputClass", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as TestOutputClass } - - async FnOutputClassList(input: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async FnOutputClassList( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'FnOutputClassList', + "FnOutputClassList", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as TestOutputClass[] } - - async FnOutputClassNested(input: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async FnOutputClassNested( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'FnOutputClassNested', + "FnOutputClassNested", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as TestClassNested } - - async FnOutputClassWithEnum(input: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async FnOutputClassWithEnum( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'FnOutputClassWithEnum', + "FnOutputClassWithEnum", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as TestClassWithEnum } - - async FnOutputStringList(input: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async FnOutputStringList( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'FnOutputStringList', + "FnOutputStringList", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string[] } - - async FnTestAliasedEnumOutput(input: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async FnTestAliasedEnumOutput( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'FnTestAliasedEnumOutput', + "FnTestAliasedEnumOutput", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as TestEnum } - - async FnTestClassAlias(input: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async FnTestClassAlias( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'FnTestClassAlias', + "FnTestClassAlias", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as TestClassAlias } - + async FnTestNamedArgsSingleEnum( - myArg: NamedArgsSingleEnum, - __baml_options__?: { tb?: TypeBuilder }, + myArg: NamedArgsSingleEnum, + __baml_options__?: { tb?: TypeBuilder } ): Promise { const raw = await this.runtime.callFunction( - 'FnTestNamedArgsSingleEnum', + "FnTestNamedArgsSingleEnum", { - myArg: myArg, + "myArg": myArg }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - - async GetDataType(text: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async GetDataType( + text: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'GetDataType', + "GetDataType", { - text: text, + "text": text }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as RaysData } - - async GetOrderInfo(email: Email, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async GetOrderInfo( + email: Email, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'GetOrderInfo', + "GetOrderInfo", { - email: email, + "email": email }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as OrderInfo } - - async GetQuery(query: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async GetQuery( + query: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'GetQuery', + "GetQuery", { - query: query, + "query": query }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as SearchParams } - - async MyFunc(input: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async MyFunc( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'MyFunc', + "MyFunc", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as DynamicOutput } - + async OptionalTest_Function( - input: string, - __baml_options__?: { tb?: TypeBuilder }, + input: string, + __baml_options__?: { tb?: TypeBuilder } ): Promise<(OptionalTest_ReturnType | null)[]> { const raw = await this.runtime.callFunction( - 'OptionalTest_Function', + "OptionalTest_Function", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as (OptionalTest_ReturnType | null)[] } - - async PromptTestClaude(input: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async PromptTestClaude( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'PromptTestClaude', + "PromptTestClaude", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - - async PromptTestClaudeChat(input: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async PromptTestClaudeChat( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'PromptTestClaudeChat', + "PromptTestClaudeChat", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - - async PromptTestClaudeChatNoSystem(input: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async PromptTestClaudeChatNoSystem( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'PromptTestClaudeChatNoSystem', + "PromptTestClaudeChatNoSystem", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - - async PromptTestOpenAIChat(input: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async PromptTestOpenAIChat( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'PromptTestOpenAIChat', + "PromptTestOpenAIChat", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - - async PromptTestOpenAIChatNoSystem(input: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async PromptTestOpenAIChatNoSystem( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'PromptTestOpenAIChatNoSystem', + "PromptTestOpenAIChatNoSystem", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - - async PromptTestStreaming(input: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async PromptTestStreaming( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'PromptTestStreaming', + "PromptTestStreaming", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - - async TestAnthropic(input: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async TestAnthropic( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'TestAnthropic', + "TestAnthropic", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - - async TestAws(input: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async TestAws( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'TestAws', + "TestAws", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - - async TestAzure(input: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async TestAzure( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'TestAzure', + "TestAzure", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - - async TestFallbackClient(__baml_options__?: { tb?: TypeBuilder }): Promise { + + async TestFallbackClient( + + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'TestFallbackClient', - {}, + "TestFallbackClient", + { + + }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - - async TestFnNamedArgsSingleBool(myBool: boolean, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async TestFnNamedArgsSingleBool( + myBool: boolean, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'TestFnNamedArgsSingleBool', + "TestFnNamedArgsSingleBool", { - myBool: myBool, + "myBool": myBool }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - + async TestFnNamedArgsSingleClass( - myArg: NamedArgsSingleClass, - __baml_options__?: { tb?: TypeBuilder }, + myArg: NamedArgsSingleClass, + __baml_options__?: { tb?: TypeBuilder } ): Promise { const raw = await this.runtime.callFunction( - 'TestFnNamedArgsSingleClass', + "TestFnNamedArgsSingleClass", { - myArg: myArg, + "myArg": myArg }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - + async TestFnNamedArgsSingleEnumList( - myArg: NamedArgsSingleEnumList[], - __baml_options__?: { tb?: TypeBuilder }, + myArg: NamedArgsSingleEnumList[], + __baml_options__?: { tb?: TypeBuilder } ): Promise { const raw = await this.runtime.callFunction( - 'TestFnNamedArgsSingleEnumList', + "TestFnNamedArgsSingleEnumList", { - myArg: myArg, + "myArg": myArg }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - - async TestFnNamedArgsSingleFloat(myFloat: number, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async TestFnNamedArgsSingleFloat( + myFloat: number, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'TestFnNamedArgsSingleFloat', + "TestFnNamedArgsSingleFloat", { - myFloat: myFloat, + "myFloat": myFloat }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - - async TestFnNamedArgsSingleInt(myInt: number, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async TestFnNamedArgsSingleInt( + myInt: number, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'TestFnNamedArgsSingleInt', + "TestFnNamedArgsSingleInt", { - myInt: myInt, + "myInt": myInt }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - - async TestFnNamedArgsSingleString(myString: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async TestFnNamedArgsSingleString( + myString: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'TestFnNamedArgsSingleString', + "TestFnNamedArgsSingleString", { - myString: myString, + "myString": myString }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - + async TestFnNamedArgsSingleStringArray( - myStringArray: string[], - __baml_options__?: { tb?: TypeBuilder }, + myStringArray: string[], + __baml_options__?: { tb?: TypeBuilder } ): Promise { const raw = await this.runtime.callFunction( - 'TestFnNamedArgsSingleStringArray', + "TestFnNamedArgsSingleStringArray", { - myStringArray: myStringArray, + "myStringArray": myStringArray }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - - async TestFnNamedArgsSingleStringList(myArg: string[], __baml_options__?: { tb?: TypeBuilder }): Promise { + + async TestFnNamedArgsSingleStringList( + myArg: string[], + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'TestFnNamedArgsSingleStringList', + "TestFnNamedArgsSingleStringList", { - myArg: myArg, + "myArg": myArg }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - - async TestGemini(input: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async TestGemini( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'TestGemini', + "TestGemini", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - - async TestImageInput(img: Image, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async TestImageInput( + img: Image, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'TestImageInput', + "TestImageInput", { - img: img, + "img": img }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - + async TestMulticlassNamedArgs( - myArg: NamedArgsSingleClass, - myArg2: NamedArgsSingleClass, - __baml_options__?: { tb?: TypeBuilder }, + myArg: NamedArgsSingleClass,myArg2: NamedArgsSingleClass, + __baml_options__?: { tb?: TypeBuilder } ): Promise { const raw = await this.runtime.callFunction( - 'TestMulticlassNamedArgs', + "TestMulticlassNamedArgs", { - myArg: myArg, - myArg2: myArg2, + "myArg": myArg,"myArg2": myArg2 }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - - async TestOllama(input: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async TestOllama( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'TestOllama', + "TestOllama", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - - async TestOpenAI(input: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async TestOpenAI( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'TestOpenAI', + "TestOpenAI", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - - async TestOpenAILegacyProvider(input: string, __baml_options__?: { tb?: TypeBuilder }): Promise { + + async TestOpenAILegacyProvider( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'TestOpenAILegacyProvider', + "TestOpenAILegacyProvider", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - - async TestRetryConstant(__baml_options__?: { tb?: TypeBuilder }): Promise { + + async TestRetryConstant( + + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'TestRetryConstant', - {}, + "TestRetryConstant", + { + + }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - - async TestRetryExponential(__baml_options__?: { tb?: TypeBuilder }): Promise { + + async TestRetryExponential( + + __baml_options__?: { tb?: TypeBuilder } + ): Promise { const raw = await this.runtime.callFunction( - 'TestRetryExponential', - {}, + "TestRetryExponential", + { + + }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as string } - + async UnionTest_Function( - input: string | boolean, - __baml_options__?: { tb?: TypeBuilder }, + input: string | boolean, + __baml_options__?: { tb?: TypeBuilder } ): Promise { const raw = await this.runtime.callFunction( - 'UnionTest_Function', + "UnionTest_Function", { - input: input, + "input": input }, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) return raw.parsed() as UnionTest_ReturnType } + } class BamlStreamClient { - constructor( - private runtime: BamlRuntime, - private ctx_manager: BamlCtxManager, - ) {} + constructor(private runtime: BamlRuntime, private ctx_manager: BamlCtxManager) {} + AudioInput( - aud: Audio, - __baml_options__?: { tb?: TypeBuilder }, - ): BamlStream, Response> { + aud: Audio, + __baml_options__?: { tb?: TypeBuilder } + ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'AudioInput', + "AudioInput", { - aud: aud, + "aud": aud }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), ) - return new BamlStream, Response>( + return new BamlStream, string>( raw, (a): a is RecursivePartialNull => a, (a): a is string => a, @@ -906,15 +998,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + ClassifyMessage( - input: string, - __baml_options__?: { tb?: TypeBuilder }, + input: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, Category> { const raw = this.runtime.streamFunction( - 'ClassifyMessage', + "ClassifyMessage", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -928,15 +1020,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + ClassifyMessage2( - input: string, - __baml_options__?: { tb?: TypeBuilder }, + input: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, Category> { const raw = this.runtime.streamFunction( - 'ClassifyMessage2', + "ClassifyMessage2", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -950,15 +1042,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + ClassifyMessage3( - input: string, - __baml_options__?: { tb?: TypeBuilder }, + input: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, Category> { const raw = this.runtime.streamFunction( - 'ClassifyMessage3', + "ClassifyMessage3", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -972,12 +1064,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - - DescribeImage(img: Image, __baml_options__?: { tb?: TypeBuilder }): BamlStream, string> { + + DescribeImage( + img: Image, + __baml_options__?: { tb?: TypeBuilder } + ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'DescribeImage', + "DescribeImage", { - img: img, + "img": img }, undefined, this.ctx_manager.cloneContext(), @@ -991,17 +1086,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + DescribeImage2( - classWithImage: ClassWithImage, - img2: Image, - __baml_options__?: { tb?: TypeBuilder }, + classWithImage: ClassWithImage,img2: Image, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'DescribeImage2', + "DescribeImage2", { - classWithImage: classWithImage, - img2: img2, + "classWithImage": classWithImage,"img2": img2 }, undefined, this.ctx_manager.cloneContext(), @@ -1015,17 +1108,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + DescribeImage3( - classWithImage: ClassWithImage, - img2: Image, - __baml_options__?: { tb?: TypeBuilder }, + classWithImage: ClassWithImage,img2: Image, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'DescribeImage3', + "DescribeImage3", { - classWithImage: classWithImage, - img2: img2, + "classWithImage": classWithImage,"img2": img2 }, undefined, this.ctx_manager.cloneContext(), @@ -1039,17 +1130,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + DescribeImage4( - classWithImage: ClassWithImage, - img2: Image, - __baml_options__?: { tb?: TypeBuilder }, + classWithImage: ClassWithImage,img2: Image, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'DescribeImage4', + "DescribeImage4", { - classWithImage: classWithImage, - img2: img2, + "classWithImage": classWithImage,"img2": img2 }, undefined, this.ctx_manager.cloneContext(), @@ -1063,15 +1152,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + DynamicFunc( - input: DynamicClassOne, - __baml_options__?: { tb?: TypeBuilder }, + input: DynamicClassOne, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, DynamicClassTwo> { const raw = this.runtime.streamFunction( - 'DynamicFunc', + "DynamicFunc", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -1085,15 +1174,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + DynamicInputOutput( - input: DynInputOutput, - __baml_options__?: { tb?: TypeBuilder }, + input: DynInputOutput, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, DynInputOutput> { const raw = this.runtime.streamFunction( - 'DynamicInputOutput', + "DynamicInputOutput", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -1107,15 +1196,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + DynamicListInputOutput( - input: DynInputOutput[], - __baml_options__?: { tb?: TypeBuilder }, + input: DynInputOutput[], + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, DynInputOutput[]> { const raw = this.runtime.streamFunction( - 'DynamicListInputOutput', + "DynamicListInputOutput", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -1129,15 +1218,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + ExtractNames( - input: string, - __baml_options__?: { tb?: TypeBuilder }, + input: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, string[]> { const raw = this.runtime.streamFunction( - 'ExtractNames', + "ExtractNames", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -1151,15 +1240,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + ExtractPeople( - text: string, - __baml_options__?: { tb?: TypeBuilder }, + text: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, Person[]> { const raw = this.runtime.streamFunction( - 'ExtractPeople', + "ExtractPeople", { - text: text, + "text": text }, undefined, this.ctx_manager.cloneContext(), @@ -1173,15 +1262,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + ExtractReceiptInfo( - email: string, - __baml_options__?: { tb?: TypeBuilder }, + email: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, ReceiptInfo> { const raw = this.runtime.streamFunction( - 'ExtractReceiptInfo', + "ExtractReceiptInfo", { - email: email, + "email": email }, undefined, this.ctx_manager.cloneContext(), @@ -1195,17 +1284,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + ExtractResume( - resume: string, - img?: Image | null, - __baml_options__?: { tb?: TypeBuilder }, + resume: string,img?: Image | null, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, Resume> { const raw = this.runtime.streamFunction( - 'ExtractResume', + "ExtractResume", { - resume: resume, - img: img ?? null, + "resume": resume,"img": img ?? null }, undefined, this.ctx_manager.cloneContext(), @@ -1219,15 +1306,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + ExtractResume2( - resume: string, - __baml_options__?: { tb?: TypeBuilder }, + resume: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, Resume> { const raw = this.runtime.streamFunction( - 'ExtractResume2', + "ExtractResume2", { - resume: resume, + "resume": resume }, undefined, this.ctx_manager.cloneContext(), @@ -1241,15 +1328,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + FnClassOptionalOutput( - input: string, - __baml_options__?: { tb?: TypeBuilder }, + input: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, ClassOptionalOutput | null> { const raw = this.runtime.streamFunction( - 'FnClassOptionalOutput', + "FnClassOptionalOutput", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -1263,15 +1350,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + FnClassOptionalOutput2( - input: string, - __baml_options__?: { tb?: TypeBuilder }, + input: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, ClassOptionalOutput2 | null> { const raw = this.runtime.streamFunction( - 'FnClassOptionalOutput2', + "FnClassOptionalOutput2", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -1285,15 +1372,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + FnEnumListOutput( - input: string, - __baml_options__?: { tb?: TypeBuilder }, + input: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, EnumOutput[]> { const raw = this.runtime.streamFunction( - 'FnEnumListOutput', + "FnEnumListOutput", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -1307,15 +1394,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + FnEnumOutput( - input: string, - __baml_options__?: { tb?: TypeBuilder }, + input: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, EnumOutput> { const raw = this.runtime.streamFunction( - 'FnEnumOutput', + "FnEnumOutput", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -1329,15 +1416,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + FnNamedArgsSingleStringOptional( - myString?: string | null, - __baml_options__?: { tb?: TypeBuilder }, + myString?: string | null, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'FnNamedArgsSingleStringOptional', + "FnNamedArgsSingleStringOptional", { - myString: myString ?? null, + "myString": myString ?? null }, undefined, this.ctx_manager.cloneContext(), @@ -1351,15 +1438,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + FnOutputBool( - input: string, - __baml_options__?: { tb?: TypeBuilder }, + input: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, boolean> { const raw = this.runtime.streamFunction( - 'FnOutputBool', + "FnOutputBool", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -1373,15 +1460,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + FnOutputClass( - input: string, - __baml_options__?: { tb?: TypeBuilder }, + input: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, TestOutputClass> { const raw = this.runtime.streamFunction( - 'FnOutputClass', + "FnOutputClass", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -1395,15 +1482,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + FnOutputClassList( - input: string, - __baml_options__?: { tb?: TypeBuilder }, + input: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, TestOutputClass[]> { const raw = this.runtime.streamFunction( - 'FnOutputClassList', + "FnOutputClassList", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -1417,15 +1504,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + FnOutputClassNested( - input: string, - __baml_options__?: { tb?: TypeBuilder }, + input: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, TestClassNested> { const raw = this.runtime.streamFunction( - 'FnOutputClassNested', + "FnOutputClassNested", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -1439,15 +1526,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + FnOutputClassWithEnum( - input: string, - __baml_options__?: { tb?: TypeBuilder }, + input: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, TestClassWithEnum> { const raw = this.runtime.streamFunction( - 'FnOutputClassWithEnum', + "FnOutputClassWithEnum", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -1461,15 +1548,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + FnOutputStringList( - input: string, - __baml_options__?: { tb?: TypeBuilder }, + input: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, string[]> { const raw = this.runtime.streamFunction( - 'FnOutputStringList', + "FnOutputStringList", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -1483,15 +1570,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + FnTestAliasedEnumOutput( - input: string, - __baml_options__?: { tb?: TypeBuilder }, + input: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, TestEnum> { const raw = this.runtime.streamFunction( - 'FnTestAliasedEnumOutput', + "FnTestAliasedEnumOutput", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -1505,15 +1592,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + FnTestClassAlias( - input: string, - __baml_options__?: { tb?: TypeBuilder }, + input: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, TestClassAlias> { const raw = this.runtime.streamFunction( - 'FnTestClassAlias', + "FnTestClassAlias", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -1527,15 +1614,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + FnTestNamedArgsSingleEnum( - myArg: NamedArgsSingleEnum, - __baml_options__?: { tb?: TypeBuilder }, + myArg: NamedArgsSingleEnum, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'FnTestNamedArgsSingleEnum', + "FnTestNamedArgsSingleEnum", { - myArg: myArg, + "myArg": myArg }, undefined, this.ctx_manager.cloneContext(), @@ -1549,15 +1636,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + GetDataType( - text: string, - __baml_options__?: { tb?: TypeBuilder }, + text: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, RaysData> { const raw = this.runtime.streamFunction( - 'GetDataType', + "GetDataType", { - text: text, + "text": text }, undefined, this.ctx_manager.cloneContext(), @@ -1571,15 +1658,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + GetOrderInfo( - email: Email, - __baml_options__?: { tb?: TypeBuilder }, + email: Email, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, OrderInfo> { const raw = this.runtime.streamFunction( - 'GetOrderInfo', + "GetOrderInfo", { - email: email, + "email": email }, undefined, this.ctx_manager.cloneContext(), @@ -1593,15 +1680,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + GetQuery( - query: string, - __baml_options__?: { tb?: TypeBuilder }, + query: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, SearchParams> { const raw = this.runtime.streamFunction( - 'GetQuery', + "GetQuery", { - query: query, + "query": query }, undefined, this.ctx_manager.cloneContext(), @@ -1615,15 +1702,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + MyFunc( - input: string, - __baml_options__?: { tb?: TypeBuilder }, + input: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, DynamicOutput> { const raw = this.runtime.streamFunction( - 'MyFunc', + "MyFunc", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -1637,15 +1724,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + OptionalTest_Function( - input: string, - __baml_options__?: { tb?: TypeBuilder }, + input: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, (OptionalTest_ReturnType | null)[]> { const raw = this.runtime.streamFunction( - 'OptionalTest_Function', + "OptionalTest_Function", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -1659,15 +1746,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + PromptTestClaude( - input: string, - __baml_options__?: { tb?: TypeBuilder }, + input: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'PromptTestClaude', + "PromptTestClaude", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -1681,15 +1768,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + PromptTestClaudeChat( - input: string, - __baml_options__?: { tb?: TypeBuilder }, + input: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'PromptTestClaudeChat', + "PromptTestClaudeChat", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -1703,15 +1790,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + PromptTestClaudeChatNoSystem( - input: string, - __baml_options__?: { tb?: TypeBuilder }, + input: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'PromptTestClaudeChatNoSystem', + "PromptTestClaudeChatNoSystem", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -1725,15 +1812,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + PromptTestOpenAIChat( - input: string, - __baml_options__?: { tb?: TypeBuilder }, + input: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'PromptTestOpenAIChat', + "PromptTestOpenAIChat", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -1747,15 +1834,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + PromptTestOpenAIChatNoSystem( - input: string, - __baml_options__?: { tb?: TypeBuilder }, + input: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'PromptTestOpenAIChatNoSystem', + "PromptTestOpenAIChatNoSystem", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -1769,15 +1856,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + PromptTestStreaming( - input: string, - __baml_options__?: { tb?: TypeBuilder }, + input: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'PromptTestStreaming', + "PromptTestStreaming", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -1791,15 +1878,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + TestAnthropic( - input: string, - __baml_options__?: { tb?: TypeBuilder }, + input: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'TestAnthropic', + "TestAnthropic", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -1813,12 +1900,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - - TestAws(input: string, __baml_options__?: { tb?: TypeBuilder }): BamlStream, string> { + + TestAws( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'TestAws', + "TestAws", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -1832,12 +1922,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - - TestAzure(input: string, __baml_options__?: { tb?: TypeBuilder }): BamlStream, string> { + + TestAzure( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'TestAzure', + "TestAzure", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -1851,11 +1944,16 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - - TestFallbackClient(__baml_options__?: { tb?: TypeBuilder }): BamlStream, string> { + + TestFallbackClient( + + __baml_options__?: { tb?: TypeBuilder } + ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'TestFallbackClient', - {}, + "TestFallbackClient", + { + + }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -1868,15 +1966,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + TestFnNamedArgsSingleBool( - myBool: boolean, - __baml_options__?: { tb?: TypeBuilder }, + myBool: boolean, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'TestFnNamedArgsSingleBool', + "TestFnNamedArgsSingleBool", { - myBool: myBool, + "myBool": myBool }, undefined, this.ctx_manager.cloneContext(), @@ -1890,15 +1988,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + TestFnNamedArgsSingleClass( - myArg: NamedArgsSingleClass, - __baml_options__?: { tb?: TypeBuilder }, + myArg: NamedArgsSingleClass, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'TestFnNamedArgsSingleClass', + "TestFnNamedArgsSingleClass", { - myArg: myArg, + "myArg": myArg }, undefined, this.ctx_manager.cloneContext(), @@ -1912,15 +2010,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + TestFnNamedArgsSingleEnumList( - myArg: NamedArgsSingleEnumList[], - __baml_options__?: { tb?: TypeBuilder }, + myArg: NamedArgsSingleEnumList[], + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'TestFnNamedArgsSingleEnumList', + "TestFnNamedArgsSingleEnumList", { - myArg: myArg, + "myArg": myArg }, undefined, this.ctx_manager.cloneContext(), @@ -1934,15 +2032,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + TestFnNamedArgsSingleFloat( - myFloat: number, - __baml_options__?: { tb?: TypeBuilder }, + myFloat: number, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'TestFnNamedArgsSingleFloat', + "TestFnNamedArgsSingleFloat", { - myFloat: myFloat, + "myFloat": myFloat }, undefined, this.ctx_manager.cloneContext(), @@ -1956,15 +2054,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + TestFnNamedArgsSingleInt( - myInt: number, - __baml_options__?: { tb?: TypeBuilder }, + myInt: number, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'TestFnNamedArgsSingleInt', + "TestFnNamedArgsSingleInt", { - myInt: myInt, + "myInt": myInt }, undefined, this.ctx_manager.cloneContext(), @@ -1978,15 +2076,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + TestFnNamedArgsSingleString( - myString: string, - __baml_options__?: { tb?: TypeBuilder }, + myString: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'TestFnNamedArgsSingleString', + "TestFnNamedArgsSingleString", { - myString: myString, + "myString": myString }, undefined, this.ctx_manager.cloneContext(), @@ -2000,15 +2098,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + TestFnNamedArgsSingleStringArray( - myStringArray: string[], - __baml_options__?: { tb?: TypeBuilder }, + myStringArray: string[], + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'TestFnNamedArgsSingleStringArray', + "TestFnNamedArgsSingleStringArray", { - myStringArray: myStringArray, + "myStringArray": myStringArray }, undefined, this.ctx_manager.cloneContext(), @@ -2022,15 +2120,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + TestFnNamedArgsSingleStringList( - myArg: string[], - __baml_options__?: { tb?: TypeBuilder }, + myArg: string[], + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'TestFnNamedArgsSingleStringList', + "TestFnNamedArgsSingleStringList", { - myArg: myArg, + "myArg": myArg }, undefined, this.ctx_manager.cloneContext(), @@ -2044,12 +2142,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - - TestGemini(input: string, __baml_options__?: { tb?: TypeBuilder }): BamlStream, string> { + + TestGemini( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'TestGemini', + "TestGemini", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -2063,15 +2164,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + TestImageInput( - img: Image, - __baml_options__?: { tb?: TypeBuilder }, + img: Image, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'TestImageInput', + "TestImageInput", { - img: img, + "img": img }, undefined, this.ctx_manager.cloneContext(), @@ -2085,17 +2186,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + TestMulticlassNamedArgs( - myArg: NamedArgsSingleClass, - myArg2: NamedArgsSingleClass, - __baml_options__?: { tb?: TypeBuilder }, + myArg: NamedArgsSingleClass,myArg2: NamedArgsSingleClass, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'TestMulticlassNamedArgs', + "TestMulticlassNamedArgs", { - myArg: myArg, - myArg2: myArg2, + "myArg": myArg,"myArg2": myArg2 }, undefined, this.ctx_manager.cloneContext(), @@ -2109,12 +2208,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - - TestOllama(input: string, __baml_options__?: { tb?: TypeBuilder }): BamlStream, string> { + + TestOllama( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'TestOllama', + "TestOllama", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -2128,12 +2230,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - - TestOpenAI(input: string, __baml_options__?: { tb?: TypeBuilder }): BamlStream, string> { + + TestOpenAI( + input: string, + __baml_options__?: { tb?: TypeBuilder } + ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'TestOpenAI', + "TestOpenAI", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -2147,15 +2252,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + TestOpenAILegacyProvider( - input: string, - __baml_options__?: { tb?: TypeBuilder }, + input: string, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'TestOpenAILegacyProvider', + "TestOpenAILegacyProvider", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -2169,11 +2274,16 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - - TestRetryConstant(__baml_options__?: { tb?: TypeBuilder }): BamlStream, string> { + + TestRetryConstant( + + __baml_options__?: { tb?: TypeBuilder } + ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'TestRetryConstant', - {}, + "TestRetryConstant", + { + + }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2186,11 +2296,16 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - - TestRetryExponential(__baml_options__?: { tb?: TypeBuilder }): BamlStream, string> { + + TestRetryExponential( + + __baml_options__?: { tb?: TypeBuilder } + ): BamlStream, string> { const raw = this.runtime.streamFunction( - 'TestRetryExponential', - {}, + "TestRetryExponential", + { + + }, undefined, this.ctx_manager.cloneContext(), __baml_options__?.tb?.__tb(), @@ -2203,15 +2318,15 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } - + UnionTest_Function( - input: string | boolean, - __baml_options__?: { tb?: TypeBuilder }, + input: string | boolean, + __baml_options__?: { tb?: TypeBuilder } ): BamlStream, UnionTest_ReturnType> { const raw = this.runtime.streamFunction( - 'UnionTest_Function', + "UnionTest_Function", { - input: input, + "input": input }, undefined, this.ctx_manager.cloneContext(), @@ -2225,4 +2340,5 @@ class BamlStreamClient { __baml_options__?.tb?.__tb(), ) } -} + +} \ 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 52864dcc3..c1f3ddfe6 100644 --- a/integ-tests/typescript/baml_client/inlinedbaml.ts +++ b/integ-tests/typescript/baml_client/inlinedbaml.ts @@ -23,14 +23,14 @@ const fileMap = { "fiddle-examples/classify-message.baml": "// This will be available as an enum in your Python and Typescript code.\nenum Category {\n Refund\n CancelOrder\n TechnicalSupport\n AccountIssue\n Question\n}\n\nfunction ClassifyMessage(input: string) -> Category {\n client GPT4\n\n prompt #\"\n Classify the following INPUT into ONE\n of the following categories:\n\n INPUT: {{ input }}\n\n {{ ctx.output_format }}\n\n Response:\n \"#\n}", "fiddle-examples/extract-names.baml": "function ExtractNames(input: string) -> string[] {\n client GPT4\n prompt #\"\n Extract the names from this INPUT:\n \n INPUT:\n ---\n {{ input }}\n ---\n\n {{ ctx.output_format }}\n\n Response:\n \"#\n}\n", "fiddle-examples/extract-receipt-info.baml": "class ReceiptItem {\n name string\n description string?\n quantity int\n price float\n}\n\nclass ReceiptInfo {\n items ReceiptItem[]\n total_cost float?\n}\n\nfunction ExtractReceiptInfo(email: string) -> ReceiptInfo {\n client GPT4o\n prompt #\"\n Given the receipt below:\n\n ```\n {{email}}\n ```\n\n {{ ctx.output_format }}\n \"#\n}\n\n", - "fiddle-examples/images/image.baml": "function DescribeImage(img: image) -> string {\n client AwsBedrock\n prompt #\"\n {{ _.role(\"user\") }}\n\n\n Describe the image below in 20 words:\n {{ img }}\n \"#\n\n}\n\nclass FakeImage {\n url string\n}\n\nclass ClassWithImage {\n myImage image\n param2 string\n fake_image FakeImage\n}\n\n// chat role user present\nfunction DescribeImage2(classWithImage: ClassWithImage, img2: image) -> string {\n client GPT4Turbo\n prompt #\"\n {{ _.role(\"user\") }}\n You should return 2 answers that answer the following commands.\n\n 1. Describe this in 5 words:\n {{ classWithImage.myImage }}\n\n 2. Also tell me what's happening here in one sentence:\n {{ img2 }}\n \"#\n}\n\n// no chat role\nfunction DescribeImage3(classWithImage: ClassWithImage, img2: image) -> string {\n client GPT4Turbo\n prompt #\"\n Describe this in 5 words:\n {{ classWithImage.myImage }}\n\n Tell me also what's happening here in one sentence and relate it to the word {{ classWithImage.param2 }}:\n {{ img2 }}\n \"#\n}\n\n\n// system prompt and chat prompt\nfunction DescribeImage4(classWithImage: ClassWithImage, img2: image) -> string {\n client GPT4Turbo\n prompt #\"\n {{ _.role(\"system\")}}\n\n Describe this in 5 words:\n {{ classWithImage.myImage }}\n\n Tell me also what's happening here in one sentence and relate it to the word {{ classWithImage.param2 }}:\n {{ img2 }}\n \"#\n}\n\ntest TestName {\n functions [DescribeImage]\n args {\n img { url \"http://imgs.xkcd.com/comics/standards.png\" }\n }\n}\n", + "fiddle-examples/images/image.baml": "function DescribeImage(img: image) -> string {\n client AwsBedrock\n prompt #\"\n {{ _.role(\"user\") }}\n\n\n Describe the image below in 20 words:\n {{ img }}\n \"#\n\n}\n\nclass FakeImage {\n url string\n}\n\nclass ClassWithImage {\n myImage image\n param2 string\n fake_image FakeImage\n}\n\n// chat role user present\nfunction DescribeImage2(classWithImage: ClassWithImage, img2: image) -> string { \n client GPT4Turbo\n prompt #\"\n {{ _.role(\"user\") }}\n You should return 2 answers that answer the following commands.\n\n 1. Describe this in 5 words:\n {{ classWithImage.myImage }}\n\n 2. Also tell me what's happening here in one sentence:\n {{ img2 }}\n \"#\n}\n\n// no chat role\nfunction DescribeImage3(classWithImage: ClassWithImage, img2: image) -> string {\n client GPT4Turbo\n prompt #\"\n Describe this in 5 words:\n {{ classWithImage.myImage }}\n\n Tell me also what's happening here in one sentence and relate it to the word {{ classWithImage.param2 }}:\n {{ img2 }}\n \"#\n}\n\n\n// system prompt and chat prompt\nfunction DescribeImage4(classWithImage: ClassWithImage, img2: image) -> string {\n client GPT4Turbo\n prompt #\"\n {{ _.role(\"system\")}}\n\n Describe this in 5 words:\n {{ classWithImage.myImage }}\n\n Tell me also what's happening here in one sentence and relate it to the word {{ classWithImage.param2 }}:\n {{ img2 }}\n \"#\n}\n\ntest TestName {\n functions [DescribeImage]\n args {\n img { url \"https://imgs.xkcd.com/comics/standards.png\"}\n }\n}\n", "fiddle-examples/symbol-tuning.baml": "enum Category3 {\n Refund @alias(\"k1\")\n @description(\"Customer wants to refund a product\")\n\n CancelOrder @alias(\"k2\")\n @description(\"Customer wants to cancel an order\")\n\n TechnicalSupport @alias(\"k3\")\n @description(\"Customer needs help with a technical issue unrelated to account creation or login\")\n\n AccountIssue @alias(\"k4\")\n @description(\"Specifically relates to account-login or account-creation\")\n\n Question @alias(\"k5\")\n @description(\"Customer has a question\")\n}\n\nfunction ClassifyMessage3(input: string) -> Category {\n client GPT4\n\n prompt #\"\n Classify the following INPUT into ONE\n of the following categories:\n\n INPUT: {{ input }}\n\n {{ ctx.output_format }}\n\n Response:\n \"#\n}", "main.baml": "generator lang_python {\n output_type python/pydantic\n output_dir \"../python\"\n}\n\ngenerator lang_typescript {\n output_type typescript\n output_dir \"../typescript\"\n}\n\ngenerator lang_ruby {\n output_type ruby/sorbet\n output_dir \"../ruby\"\n}\n", "test-files/aliases/classes.baml": "class TestClassAlias {\n key string @alias(\"key-dash\") @description(#\"\n This is a description for key\n af asdf\n \"#)\n key2 string @alias(\"key21\")\n key3 string @alias(\"key with space\")\n key4 string //unaliased\n key5 string @alias(\"key.with.punctuation/123\")\n}\n\nfunction FnTestClassAlias(input: string) -> TestClassAlias {\n client GPT35\n prompt #\"\n {{ctx.output_format}}\n \"#\n}\n\ntest FnTestClassAlias {\n functions [FnTestClassAlias]\n args {\n input \"example input\"\n }\n}\n", "test-files/aliases/enums.baml": "enum TestEnum {\n A @alias(\"k1\") @description(#\"\n User is angry\n \"#)\n B @alias(\"k22\") @description(#\"\n User is happy\n \"#)\n // tests whether k1 doesnt incorrectly get matched with k11\n C @alias(\"k11\") @description(#\"\n User is sad\n \"#)\n D @alias(\"k44\") @description(\n User is confused\n )\n E @description(\n User is excited\n )\n F @alias(\"k5\") // only alias\n \n G @alias(\"k6\") @description(#\"\n User is bored\n With a long description\n \"#)\n \n @@alias(\"Category\")\n}\n\nfunction FnTestAliasedEnumOutput(input: string) -> TestEnum {\n client GPT35\n prompt #\"\n Classify the user input into the following category\n \n {{ ctx.output_format }}\n\n {{ _.role('user') }}\n {{input}}\n\n {{ _.role('assistant') }}\n Category ID:\n \"#\n}\n\ntest FnTestAliasedEnumOutput {\n functions [FnTestAliasedEnumOutput]\n args {\n input \"mehhhhh\"\n }\n}", "test-files/comments/comments.baml": "// add some functions, classes, enums etc with comments all over.", "test-files/dynamic/dynamic.baml": "class DynamicClassOne {\n @@dynamic\n}\n\nenum DynEnumOne {\n @@dynamic\n}\n\nenum DynEnumTwo {\n @@dynamic\n}\n\nclass SomeClassNestedDynamic {\n hi string\n @@dynamic\n\n}\n\nclass DynamicClassTwo {\n hi string\n some_class SomeClassNestedDynamic\n status DynEnumOne\n @@dynamic\n}\n\nfunction DynamicFunc(input: DynamicClassOne) -> DynamicClassTwo {\n client GPT35\n prompt #\"\n Please extract the schema from \n {{ input }}\n\n {{ ctx.output_format }}\n \"#\n}\n\nclass DynInputOutput {\n testKey string\n @@dynamic\n}\n\nfunction DynamicInputOutput(input: DynInputOutput) -> DynInputOutput {\n client GPT35\n prompt #\"\n Here is some input data:\n ----\n {{ input }}\n ----\n\n Extract the information.\n {{ ctx.output_format }}\n \"#\n}\n\nfunction DynamicListInputOutput(input: DynInputOutput[]) -> DynInputOutput[] {\n client GPT35\n prompt #\"\n Here is some input data:\n ----\n {{ input }}\n ----\n\n Extract the information.\n {{ ctx.output_format }}\n \"#\n}\n\n\n\nclass DynamicOutput {\n @@dynamic\n}\n \nfunction MyFunc(input: string) -> DynamicOutput {\n client GPT35\n prompt #\"\n Given a string, extract info using the schema:\n\n {{ input}}\n\n {{ ctx.output_format }}\n \"#\n}\n\n", - "test-files/functions/input/named-args/single/named-audio.baml": "class Response {\n type string\n reason string\n appropriate_for_video_games bool\n score int @description(#\"\n 1-5, 1 being best at video game background music and 5 being worst\n \"#)\n}\n\nfunction AudioInput(aud: audio) -> Response {\n client Gemini\n prompt #\"\n Describe the sound.\n\n {{ ctx.output_format(prefix=\"Answer in this schema:\\n\") }}\n\n\n {{ _.role(\"user\") }}\n \n {{ aud }}\n \"#\n}\n\n\ntest TestURLAudioInput{\n functions [AudioInput]\n args {\n aud{ \n url https://actions.google.com/sounds/v1/emergency/beeper_emergency_call.ogg\n }\n } \n}\n\n\n", + "test-files/functions/input/named-args/single/named-audio.baml": "function AudioInput(aud: audio) -> string{\n client Gemini\n prompt #\"\n {{ _.role(\"user\") }}\n\n Does this sound like a roar? Yes or no? One word no other characters.\n \n {{ aud }}\n \"#\n}\n\n\ntest TestURLAudioInput{\n functions [AudioInput]\n args {\n aud{ \n url https://actions.google.com/sounds/v1/emergency/beeper_emergency_call.ogg\n }\n } \n}\n\n\n", "test-files/functions/input/named-args/single/named-boolean.baml": "\n\nfunction TestFnNamedArgsSingleBool(myBool: bool) -> string{\n client GPT35\n prompt #\"\n Return this value back to me: {{myBool}}\n \"#\n}\n\ntest TestFnNamedArgsSingleBool {\n functions [TestFnNamedArgsSingleBool]\n args {\n myBool true\n }\n}", "test-files/functions/input/named-args/single/named-class-list.baml": "\n\n\nfunction TestFnNamedArgsSingleStringList(myArg: string[]) -> string{\n client GPT35\n prompt #\"\n Return this value back to me: {{myArg}}\n \"#\n}\n\ntest TestFnNamedArgsSingleStringList {\n functions [TestFnNamedArgsSingleStringList]\n args {\n myArg [\"hello\", \"world\"]\n }\n}", "test-files/functions/input/named-args/single/named-class.baml": "class NamedArgsSingleClass {\n key string\n key_two bool\n key_three int\n // TODO: doesn't work with keys with numbers\n // key2 bool\n // key3 int\n}\n\nfunction TestFnNamedArgsSingleClass(myArg: NamedArgsSingleClass) -> string {\n client GPT35\n prompt #\"\n Print these values back to me:\n {{myArg.key}}\n {{myArg.key_two}}\n {{myArg.key_three}}\n \"#\n}\n\ntest TestFnNamedArgsSingleClass {\n functions [TestFnNamedArgsSingleClass]\n args {\n myArg {\n key \"example\",\n key_two true,\n key_three 42\n }\n }\n}\n\nfunction TestMulticlassNamedArgs(myArg: NamedArgsSingleClass, myArg2: NamedArgsSingleClass) -> string {\n client GPT35\n prompt #\"\n Print these values back to me:\n {{myArg.key}}\n {{myArg.key_two}}\n {{myArg.key_three}}\n {{myArg2.key}}\n {{myArg2.key_two}}\n {{myArg2.key_three}}\n \"#\n}", @@ -65,8 +65,8 @@ const fileMap = { "test-files/strategies/fallback.baml": "\nclient FaultyClient {\n provider openai\n options {\n model unknown-model\n api_key env.OPENAI_API_KEY\n }\n}\n\n\nclient FallbackClient {\n provider fallback\n options {\n // first 2 clients are expected to fail.\n strategy [\n FaultyClient,\n RetryClientConstant,\n GPT35\n ]\n }\n}\n\nfunction TestFallbackClient() -> string {\n client FallbackClient\n // TODO make it return the client name instead\n prompt #\"\n Say a haiku about mexico.\n \"#\n}", "test-files/strategies/retry.baml": "\nretry_policy Exponential {\n max_retries 3\n strategy {\n type exponential_backoff\n }\n}\n\nretry_policy Constant {\n max_retries 3\n strategy {\n type constant_delay\n delay_ms 100\n }\n}\n\nclient RetryClientConstant {\n provider openai\n retry_policy Constant\n options {\n model \"gpt-3.5-turbo\"\n api_key \"blah\"\n }\n}\n\nclient RetryClientExponential {\n provider openai\n retry_policy Exponential\n options {\n model \"gpt-3.5-turbo\"\n api_key \"blahh\"\n }\n}\n\nfunction TestRetryConstant() -> string {\n client RetryClientConstant\n prompt #\"\n Say a haiku\n \"#\n}\n\nfunction TestRetryExponential() -> string {\n client RetryClientExponential\n prompt #\"\n Say a haiku\n \"#\n}\n", "test-files/strategies/roundrobin.baml": "", - "test-files/testing_pipeline/resume.baml": "class Resume {\n name string\n email string\n phone string\n experience string[]\n education Education[]\n skills string[]\n}\n\nclass Education {\n institution string\n location string\n degree string\n major string[]\n date string? @alias(start_date) @description(#\"\n YYYY-MM\n \"#)\n}\n\ntemplate_string AddRole(foo: string) #\"\n {{ _.role('system')}}\n You are a {{ foo }}. be nice\n\n {{ _.role('user') }}\n\"#\n\nfunction ExtractResume(resume: string, img: image?) -> Resume {\n client GPT35\n prompt #\"\n {{ AddRole(\"Software Engineer\") }}\n\n Extract data:\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 input {\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 input {\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}", + "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\nfunction ExtractResume(resume: string, img: image?) -> Resume {\n client GPT35\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 input {\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 input {\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/type_builder.ts b/integ-tests/typescript/baml_client/type_builder.ts index eaa21df5d..66d694ee4 100644 --- a/integ-tests/typescript/baml_client/type_builder.ts +++ b/integ-tests/typescript/baml_client/type_builder.ts @@ -46,7 +46,7 @@ export default class TypeBuilder { constructor() { this.tb = new _TypeBuilder({ classes: new Set([ - "Blah","ClassOptionalOutput","ClassOptionalOutput2","ClassWithImage","DynInputOutput","DynamicClassOne","DynamicClassTwo","DynamicOutput","Education","Email","Event","FakeImage","InnerClass","InnerClass2","NamedArgsSingleClass","OptionalTest_Prop1","OptionalTest_ReturnType","OrderInfo","Person","RaysData","ReceiptInfo","ReceiptItem","Response","Resume","SearchParams","SomeClassNestedDynamic","TestClassAlias","TestClassNested","TestClassWithEnum","TestOutputClass","UnionTest_ReturnType","WithReasoning", + "Blah","ClassOptionalOutput","ClassOptionalOutput2","ClassWithImage","DynInputOutput","DynamicClassOne","DynamicClassTwo","DynamicOutput","Education","Email","Event","FakeImage","InnerClass","InnerClass2","NamedArgsSingleClass","OptionalTest_Prop1","OptionalTest_ReturnType","OrderInfo","Person","RaysData","ReceiptInfo","ReceiptItem","Resume","SearchParams","SomeClassNestedDynamic","TestClassAlias","TestClassNested","TestClassWithEnum","TestOutputClass","UnionTest_ReturnType","WithReasoning", ]), enums: new Set([ "Category","Category2","Category3","Color","DataType","DynEnumOne","DynEnumTwo","EnumInClass","EnumOutput","Hobby","NamedArgsSingleEnum","NamedArgsSingleEnumList","OptionalTest_CategoryType","OrderStatus","Tag","TestEnum", diff --git a/integ-tests/typescript/baml_client/types.ts b/integ-tests/typescript/baml_client/types.ts index dfae17dc4..be0822229 100644 --- a/integ-tests/typescript/baml_client/types.ts +++ b/integ-tests/typescript/baml_client/types.ts @@ -170,7 +170,7 @@ export interface Education { location: string degree: string major: string[] - date?: string | null + graduation_date?: string | null } @@ -261,20 +261,12 @@ export interface ReceiptItem { } -export interface Response { - type: string - reason: string - appropriate_for_video_games: boolean - score: number - -} - export interface Resume { name: string email: string phone: string - experience: string[] - education: Education[] + experience: Education[] + education: string[] skills: string[] }