https://www.boundaryml.com logo
🟑 BAML 0.204.0 incompatibility with .items() filt...
# questions
s
Hi friends, thanks for all your amazing work on this project, truly love this and how it has enabled me to build faster with smaller models without having to worry so much about fine tuning to get stricter json formatted output. I was working on a project today and trying to get a nested dictionary to be evaluated via its boolean output so I could implement LLM as a Judge to create a feedback loop, but in doing so noticed that at least the version of BAML I am running (
0.204.0
) does not seem to support the β€œ.items()” jinja builtin filter. When I add this in to my baml function prompt such that I can iterate over the dictionary k:v, it seems to throw that it is an unknown method. I was curious if this is expected or if this might be a bug?

Copy code
Error occurred while rendering prompt: unknown method: map has no method named items (in prompt:16)
----------------------------------- prompt ------------------------------------
  13 | {% for note in evaluation.feedback %}- {{ note }}
  14 | {% endfor %}
  15 | 
  16 > {% for rating, needs_work in evaluation.ratings.items() %}- {{ rating }}: {{ needs_work }}
     i                                                ^^^^^^^^ unknown method
  17 | {% endfor %}
  18 | 
  19 | </feedback>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
v
You need to use |items instead of .items πŸ™‚
Jinja is dumb and we’re working on it πŸ™‚
Appreciate the support!
s
awesome, will give this a try shortly, thanks again and I definitely appreciate your support!