Latest Results
add option to output_format for quoting class keys in prompts (#2769)
Your BAML prompt can say:
```
{{ ctx.output_format(quote_class_fields=true) }}
```
and now in the prompt classes will render like:
```
Answer in JSON using this schema:
{
"hero_title": string,
"hero_subtitle": string,
"highlight": {
// 3-6 words
"name": string,
// 10-40 words
"details": string,
},
}
```
With false or no argument, it looks like the original:
```
Answer in JSON using this schema:
{
hero_title: string,
hero_subtitle: string,
highlight: {
// 3-6 words
name: string,
// 10-40 words
details: string,
},
}
```
We found that some queries on small models are hard for the models to
satisfy when there is something unconventional about the requested
output format (for instance, being asked to respond with no quotes in
front of keys, like we do by default). This change lets you easily wrap
class keys in quotes, freeing up a little bit of working memory for the
model to do other things. Active Branches
#2764×60
© 2025 CodSpeed Technology