From 8ce0a539d74d05438e8047e4e02022ddd7121e21 Mon Sep 17 00:00:00 2001 From: Greg Hale Date: Mon, 28 Oct 2024 15:06:20 -0700 Subject: [PATCH] Add links to DynamicTypes from intro pages (#1116) > [!IMPORTANT] > Adds links to Dynamic Types documentation in `supported-types.mdx` for `enum` and `class` sections. > > - **Documentation**: > - Adds links to [Dynamic Types](/docs/calling-baml/dynamic-types) in `supported-types.mdx` under `enum` and `class` sections. > - Provides guidance for adding new variants to `enum` and fields to `class` dynamically. > > This description was created by [Ellipsis](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral) for 1119858469291e1691d43334a2c42304143a139f. It will automatically update as commits are pushed. --- docs/docs/snippets/supported-types.mdx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/docs/snippets/supported-types.mdx b/docs/docs/snippets/supported-types.mdx index 78ed3a339..5c5578fe1 100644 --- a/docs/docs/snippets/supported-types.mdx +++ b/docs/docs/snippets/supported-types.mdx @@ -255,6 +255,9 @@ enum Name { } ``` +If you need to add new variants, because they need to be loaded from a file or fetched dynamically +from a database, you can do this with [Dynamic Types](/docs/calling-baml/dynamic-types). + ### class **See also:** [Class](/docs/snippets/class) @@ -273,6 +276,9 @@ class Car { } ``` +If you need to add fields to a class because some properties of your class are only +known at runtime, you can do this with [Dynamic Types](/docs/calling-baml/dynamic-types). + ### Optional (?) A type that represents a value that might or might not be present.