https://www.boundaryml.com logo
Array prompt format
# general
b
Why does
Copy code
py
type_builder {
  dynamic class ExitLoop {
    result int[]
  }
}
Promtify to:
Copy code
py
ExitLoop {
  result: int[],
}
But
Copy code
py
type_builder {
  dynamic class ExitLoop {
    result MyClass[]
  }
}
Promtify to:
Copy code
py
ExitLoop {
  result: [
    MyClass
  ],
}
?
a
Oh yeah this could definitely just be MyClass[]. It is probably an artefact for how we treat classes specially in some cases But does it not inline the class using result:[{ property1: string…}]? Since the llm still needs to know what shape MyClass is
b
I'm using
{{ ctx.output_format(hoist_classes=true, always_hoist_enums=true) }}
in my output Minor correction, in my specific case it's actually an enum and not class, so it should be
MyEnum
But same same, the enum is hoisted correctly 😆 I was just wondering if this would cause the LLM to get confused. Currently my agent that's based on GPT5 (smart boy!) is abusing one of it's other tools as the final return type instead
MyEnum[]
which i inject dynamically, trying to figure out what is going on so I just noticed this
a
I recommend always using the json format or remind the llm to return in the right format by injecting stuff like “now i will answer in the right json format”
b
I'll give it a shot, thank you for quick response. BAML team rocks 🔥
I love YELLING at and begging my LLMs to work
w
Cussing in all caps is quite effective, weirdly.