BoundaryML / baml

BAML is a language that helps you get structured data from LLMs, with the best DX possible. Works with all languages. Check out the promptfiddle.com playground
https://docs.boundaryml.com
Apache License 2.0
1.42k stars 52 forks source link

0.62 breaks dynamic enums #1079

Closed orhanhenrik closed 1 month ago

orhanhenrik commented 1 month ago

After upgrading to 0.62, running baml beaks with the following error:

<enum 'FeeType'> has no members; specify `names=()` if you meant to create a new, empty, enum

I construct my tb object like this:

    tb = type_builder.TypeBuilder()  # type: ignore[no-untyped-call]
    for value in MyPythonEnum:
        tb.FeeType.add_value(value)

And in my .baml file I have

enum FeeType {
  // Populated from enum in Python
  @@dynamic
}

Code runs fine on 0.61.1

hellovai commented 1 month ago

oh shoot! Thank you for flagging this @orhanhenrik

This a great catch. We somehow didn't have this in our integ tests. I will add a test and release a patch for this ASAP!

hellovai commented 1 month ago

This is now fixed in Release 0.63.0+