https://www.boundaryml.com logo
🟑 Is there a way to use a text file as a string i...
# questions
n
Is there a way to use a text file as a string input for tests?
v
perhaps its about time we added this πŸ₯²
we get quite a bit of requests for this
n
Do you take contribution and mind pointing me in the right direction?
v
well first we'd need to pick out the syntax. i think the closest syntax would be:
Copy code
args {
   param { file "path/to/file" }
}
we just need to be able to distinguish that in the case of:
Copy code
class MyStruct {
  file string
}

function(param: string | MyStruct)
thats why we've held off on it
we could use union left to rigth precedence
to pick
which is what we do for images
and yes we do!
I put a draft pr up here: https://github.com/BoundaryML/baml/pull/2775 to help share the parts of the code that may be needed to update
Tricky part is testing
For that you need to spin up the local vs code environment. We have a script in scripts called set up dev which you can run after cloning the repo
Which installs everything
Then it’s just a matter of running pnpm run dev:vscode
p
YES, pls πŸ™πŸ½. It's one of the biggest issues with BAML tests, and why I don't use testing in BAML for the most part any more πŸ₯²
n
thanks!
Will hit this later today and go through the code.
I think you won’t find anyone in her who has done more in vscode extensions πŸ˜‚
v
What have you worked on in th past haha
n
Amp extension is killing me πŸ˜„
v
πŸ₯²
you'll have fun with the WASM side of what we do haha
feel free to ping me @baml-sam if you get stuck!
n
Yep, hit that already πŸ˜„
It's a lot of fun πŸ˜„
v
πŸ™‚