benepstein
10/10/2025, 6:58 PMclass Picker{
fruit @dynamic
vegetables @dynamic
}
such that the attributes are set (and type safe) just the types of them are dynamic (trying to use string_literals here)baml-sam
10/10/2025, 7:00 PMbenepstein
10/10/2025, 7:30 PMbenepstein
10/10/2025, 7:35 PMenum Fruit {
@@dynamic
}
enum Vegetable {
@@dynamic
}
class Picker{
fruit Fruit
vegetable Vegetable
}benepstein
10/10/2025, 7:45 PMPicker.fruit to be of type Fruit | None but it's actually Fruit | str | None -- and calling a function that returns Picker does indeed have fruit as a string. Why isn't it the enum?
https://cdn.discordapp.com/attachments/1426282842048172052/1426294633163522108/image.png?ex=68eab3e3&is=68e96263&hm=6bda3febd1bd64f4deb32d62054375229b03d20b48c05100b5bfc6bf7186219e&
https://cdn.discordapp.com/attachments/1426282842048172052/1426294633574568068/image.png?ex=68eab3e3&is=68e96263&hm=7c02608a118e8a9cced9e6934681ee8f2ac153ef1ce2e4efccdf112bfde477ce&baml-sam
10/10/2025, 7:50 PMbaml-sam
10/10/2025, 7:51 PMbenepstein
10/10/2025, 7:51 PMbaml-sam
10/10/2025, 7:53 PMbenepstein
10/10/2025, 7:53 PMstr | None -- not str | Fruit | Nonebenepstein
10/10/2025, 7:53 PMFruit typebaml-sam
10/10/2025, 7:54 PMbenepstein
10/10/2025, 7:54 PMenum Fruit{
APPLE
@@dynamic
}
and the model picks apple, it WILL be a Fruit typebaml-sam
10/10/2025, 7:54 PMbenepstein
10/10/2025, 7:54 PMbaml-sam
10/10/2025, 7:55 PMbenepstein
10/10/2025, 7:55 PMbenepstein
10/10/2025, 7:55 PMbaml-sam
10/10/2025, 7:58 PM