https://www.boundaryml.com logo
Dynamic form filler based on document
# help
g
Attempting to create an agent that uses an existing test process document (future scope - vector database) to perform guided form completion. Taking inspiration from https://github.com/BoundaryML/baml-examples/blob/main/form-filler/baml_src/form_filler.baml - What is the best method to go about setting this up under BAML and Python?
Apologies if this seems fairly basic, still learning.
I'm defining a TestForm class with the intent to account for specific data types based on the document scope.
Copy code
class TestForm{
    field1 float[] @skip @description(#"
        Specific unit f1.
    "#)
    field2 float[] @skip @description(#"
        Specific unit f2
    "#)
    timestamp string @description(#"
        Full timestamp in UTC at time of test execution - Spreadsheet friendly
    "#)
    notes string @description(#"
        Rationale for readings collected as part of test, with aliases for relevant values.
    "#)

    @@dynamic # Accounts for additional fields I may have missed.
}
v
Hi! Were you able to figure this out? The comments in BAML are // not # btw
g
Hey Vaibhav, been a while! Still looking for input on the matter. And yes, I figured out the comments bit later 😆
b
Are you running into any issues with the code in the repo? You can just copy it all over and then run
uv sync && baml-cli generate
Best to also bump the baml version after copying it, we haven’t updated it in a while
g
No issues with the code in the repo as far as I can tell. My question mostly targets everything else around it.
b
Best practices are really just: - use uv - use the baml extension - don’t check in the generated client
If you have a more specific question, we can answer that, but otherwise I’m not sure what kind of answer you’re looking for
g
The way I see this going would be: Text document with process -> BAML schema with pass/fail criteria -> Guided form to fill and submit for review
I need some guidance on how whether this is the right choice for implementation or if there are issues I need to tackle
Also any pre-existing examples I can refer to
b
baml-examples is the pre-existing stuff 🙂
Whether this is the right choice really depends on what your inputs look like and what your goal with this project/product is
g
Truth be told, examples are spread across multiple locations AFAIK - baml-examples, ai-stuff-that-works, promptfiddle, you get the point. The goal is to automate data ingest for field service based on existing documentation.
b
We definitely need to do a better job of keeping all the stuff in one place, totally hear that!
But they’re all still relevant design examples
g
Not complaining btw, it's just a lot to keep track of.
b
> automate data ingest for field service What I’m saying is that you need to design your schema based on (1) what kind of inputs your customers are sending to you and (2) what outputs you want
Your schema seems like it could work, if “f1” and “f2” are actual fields your customers are going to send you, but if not, I have no idea what the model’s going to do
g
Oh yeah I renamed those for the ticket here, my bad
b
But as a rule of thumb: start simple, then add complexity only if you need it
g
It was voltages and resistances
b
That’s fine! But with design questions it all pivots on details
That’s why I say that you need (1) examples of inputs you’ll get and (2) what kinds of outputs you want, to design the schema
g
Makes sense. Lemme mock something up in BAML real quick.
b
Set up something that makes it easy to test- you want an iteration loop that lets you just (1) modify template (2) run the pipeline (3) repeat based on whether you’re happy or not
Dropping off, we’ve got plans for the day, but we’ll follow up when we can!
2 Views