Classification
You can write functions to classify elements using Enums.
Here is such an example:
BAML
If you use BAML Playground, you can see what we inject into the prompt, with full transparency.
The neat part about BAML is that you don’t need to parse the enums out of the answer yourself. It will just work. BAML’s fuzzy parsing detects when the LLM prints something like:
and will give you the actual Category.Refund
when you call the function. We will add more knobs so you can make this parsing more or less strict.
Usage
Handling Dynamic Categories (e.g. user-provided, or from a database)
To handle dynamic categories you can use dynamic enums to build your enum at runtime.