https://www.boundaryml.com logo
🟡 Query on BAML converting JSON results into fles...
# questions
r
Is it possible that BAML is converting raw JSON results with unique integer
id
fields per unique record into fully fleshed out results in references on edges? I think I’m seeing this with Gemini 2.5 Flash, but then I do get fully fleshed out records from BAML. This is odd because the
name
field is also required,along with
id
. Can BAML recover from this scenario where it’s seen that
id
in another context? Because I think this… wanna know if it’s expected 🙂
v
Can you post an example of what you mean? BAML can’t infer any values except for nulls, and empty lists / arrays. But it’s quite conservative when it does that.
r
I was just getting records like this returned and BAML wasn’t handling it because
name
was required.
Copy code
{
  "id": 1
}
So I just removed all type references except for these IDs. Works great, huge space savings!
There’s no reason to repeat a type a million times if you can use an id
At least on Gemini it saves MOST output tokens