https://www.boundaryml.com logo
🟡 Need guidance on using BAML to generate complex...
# questions
b
Hey team! I'm looking for some general guidance /vibe thoughts before i delve headlong into burning my weekend with BAML adventures 😅 . I'm looking to use BAML to generate a json string that has a very complex schema (1.8MB or more - One example is here https://vega.github.io/schema/vega-lite/v5.json ) . Only part of it needs be returned from each LLM call, but this may differ each time that updates chart parameters (i.e. natural language to chart formatting) Q1: Would you try implementing the entire schema, or approach it some other way? Q2: is this maybe just a dumb thing to do / maybe I am missing something entirely?
My current thinking is: (Q2) yes this is kinda dumb to do wholesale; Instead re Q1, using careful schema decomposition I could use baml as a switcher (identifying which parts of the schema i need) and then use only those relevant parts of the schema (although yes, in sum the entire schema would be encoded via the sum of those parts) Does that seem sensible?
g
It seems very sensible! Have you looked at TypeBuilder?
Is your final goal to be able to generate some vega charts from BAML? Or to host a service that lets people use the whole Vega API?
If you just want to build some basic charts, I'd manually copy the vega types into baml classes and use that directly. Easiest way. If you want to work toward all of Vega, then you can convert from json schema to TypeBuilder. Then, since the API is so big, I like your idea of using a first query to assess which parts of the API need to get loaded, then load them through TypeBuilder, and your second builder uses that constructed schema with the needed subset of vega.
b
@greg (BAML) thanks so much, I hadn't discovered TypeBuilder and this is exactly what i need! Yep i'm building a service that will host the whole Vega API (/my own APIs of similar complexity) so I'll kickoff with TypeBuilder and your recommended two-step approach.
g
Cool. Please keep me in the loop, I'd absolutely love to see such a workflow in action!
a