afr2903
10/16/2025, 4:51 PMlines even though the syntax it's correct. The error is replicable in a test case.
I'm also attaching the same test with another model that doesn't add CoT to the output, and in this case the parsing works.
In the past, when adding CoT to the output, the parser still worked so I'm confused why isn't this working.
Let me know if you need additional info, thanks!!
https://cdn.discordapp.com/attachments/1428425171491885167/1428425171722703001/image.png?ex=68f2741b&is=68f1229b&hm=3b572ea76f4ae6c58cc12d1bcf5267192ddf7867d60d78e0c89e99a42fb6352a&
https://cdn.discordapp.com/attachments/1428425171491885167/1428425172079214663/image.png?ex=68f2741b&is=68f1229b&hm=eada2d73c196ab6725edd77d0dc320baecfadb03daeeabad82df841b64378283&aaronv (BAML)
10/16/2025, 4:52 PMaaronv (BAML)
10/16/2025, 4:53 PMaaronv (BAML)
10/16/2025, 4:53 PMafr2903
10/16/2025, 5:20 PMVaibhav (BAML 🐑)
10/16/2025, 8:51 PMVaibhav (BAML 🐑)
10/16/2025, 8:51 PMVaibhav (BAML 🐑)
10/16/2025, 8:52 PMOrderLine it works!
https://cdn.discordapp.com/attachments/1428425171491885167/1428485796259696660/Screenshot_2025-10-16_at_1.52.13_PM.png?ex=68f2ac91&is=68f15b11&hm=195756fc9b881fd3126770bbcd4af496e523aa5325d1b60d2c5579f275801b94&Vaibhav (BAML 🐑)
10/16/2025, 8:52 PMOrderLine[] it failsVaibhav (BAML 🐑)
10/16/2025, 8:53 PMpython
from baml_client import b
raw_text = """
To reconstruct the order based on the provided instructions and menu, we will follow these steps:
1. **Start with an empty order**.
2. **Execute each instruction sequentially**.
3. **Build the final order state step by step**.
4. **Add to the previous state without overwriting**.
---
### Step-by-Step Execution:
**1. Instruction 1: “Cliente pidió Combo con Todo y eligió 2 empanadas de carne con queso”**
→ Create a combo with `combo_id` “combo_con_todo”
→ Add 2 items of `carne_con_queso` to the combo’s components array.
**2. Instruction 2: “Cliente quiere agregar chimichurri”**
→ Add the modifier `aderezos:bolsa_chimichurri` to the combo’s modifiers array.
---
### Final Order State:
``json
{
"lines": [
{
"item": {
"combo_id": "combo_con_todo",
"components": [
{ "id": "carne_con_queso", "name": "Carne con Queso" },
{ "id": "carne_con_queso", "name": "Carne con Queso" }
],
"modifiers": [
"aderezos:bolsa_chimichurri"
]
},
"notes": null,
"quantity": 1
}
]
}
``
---
### Explanation:
* **Instruction 1:** Created a combo with `combo_id` “combo_con_todo” and added 2 items of `carne_con_queso` to the components array.
* **Instruction 2:** Added the modifier `aderezos:bolsa_chimichurri` to the combo’s modifiers array.
"""
result = b.parse.UpdateOrderState(raw_text)
print(result)Vaibhav (BAML 🐑)
10/16/2025, 8:54 PMVaibhav (BAML 🐑)
10/16/2025, 8:59 PMOrderLine[]?
instead of:
OrderState
which only has 1 field anywaysVaibhav (BAML 🐑)
10/16/2025, 8:59 PMVaibhav (BAML 🐑)
10/16/2025, 9:03 PMdiff
class OrderState {
+ key "order_state"
lines OrderLine[]? @description("Current order lines accumulated so far")
}
top-level single key containers are the most likely to misbehave (in both the parser and llm)afr2903
10/17/2025, 6:28 AM