Python
Here’s a sample repository: https://github.com/BoundaryML/baml-examples/tree/main/python-fastapi-starter
To set up BAML in python do the following:
Install BAML VSCode Extension
https://marketplace.visualstudio.com/items?itemName=boundary.baml-extension
- syntax highlighting
- testing playground
- prompt previews
In your VSCode User Settings, highly recommend adding this to get better autocomplete for python in general, not just BAML.
Generate python code from .baml files
This command will help you convert .baml
files to .py
files. Everytime you modify your .baml
files,
you must re-run this command, and regenerate the baml_client
folder.
Our VSCode extension automatically runs this command when you save a BAML file.