https://www.boundaryml.com logo
Help with BAML Client Config to Read from .env in ...
# help
j
I have this custom client definition: client Gemini3FlashPreviewVertex { provider vertex-ai retry_policy Exponential options { model "gemini-3-flash-preview" project_id "[my_project_name]" location "global" // project_id env.GCP_PROJECT_ID // location env.GCP_LOCATION generationConfig { thinkingConfig{ thinkingLevel "low" } } } } If I hard code the
project_id
and
location
, it works. If I use env lookup as commented out, it doesn't. my monorepo is set up as: project/ - backend/ - frontend/ BAML is under backend. I tried to put .env in the root as well as backend/ Neither approach worked. Any help on how to get this working is appreciated.
a
i’m unsure if we actually natively support loading from a .env file
does it work if you pass them manually as environment variables
or use nodejs/python dot env libraries to load it
j
Hey Avery,
Thanks for the reply. Yes, when supplied directly (as the above example), they work. The env.GCP_PROJECT_ID is an example pattern that BAML has OOTB. So, I assumed that BAML was supporting it. I'll try the dot env method. I didn't think about that since I wasn't sure what other stuff was happening between BAML client definition and BAML functions. Thinking through it, it should. I'll let you know after.
a
by passed manually i mean
ENV_VAR=123 python script.py
2 Views