Open ekinsdrow opened 2 months ago
Howdy! This isn't something we support right now, unfortunately.
@alias
has no implications on the generated code; it's entirely meant to provide a way to map a given LLM string into a concrete BAML type.
We currently don't provide a mechanism for users to control what strings back a given enum - we'll look into what we can do to enable this.
Ok, thanks for the reply, in general it's not hard to fix this after receiving the reply by processing it, but it would be handy to have this feature out of the box
Got it, thanks a lot again!
Description
I am working with an enum in Dart for color values, which is used to describe text blocks in a JSON schema. After parsing using BAML, the color values are returned in PascalCase instead of lower case as expected.
The enum is defined as follows:
Example of the block in the LLm response
Response after BAML parsing
As seen, the color field is returned as
Default
instead ofdefault
, despite the description and alias specifying that it should be lower case. This forces me to apply post-processing on the client side to convert the values to lower case, which I want to avoid. How i can fix this one without post-processing on client side