Skip to content

Commit 0f5895e

Browse files
Add fiddle missing env vars fix back (#2691)
Fix was added in #2587 and lost in #2588
1 parent 2c9d204 commit 0f5895e

File tree

2 files changed

+15
-537
lines changed

2 files changed

+15
-537
lines changed

engine/baml-runtime/src/lib.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1825,7 +1825,22 @@ impl BamlRuntime {
18251825
let new_client = LLMProvider::try_from((&walker, ctx)).map(Arc::new)?;
18261826

18271827
let mut required_env_vars = HashMap::new();
1828+
1829+
let uses_proxy_server = ctx.proxy_url().is_some();
1830+
1831+
// If the client is Vertex or AWS Bedrock, we don't fail on
1832+
// missing required environment variables because we run a bunch
1833+
// of additional logic to resolve required values (i.e for
1834+
// Vertex if GOOGLE_CLOUD_PROJECT is not provided it can be
1835+
// found on the credentials property).
1836+
//
1837+
// If called with modular API, we don't fail either. User might
1838+
// want to insert the values later.
1839+
//
1840+
// When a proxy server is used, don't fail on missing required
1841+
// env vars because the proxy server is likely to provide them.
18281842
let fail_on_missing_required_env_vars = !ctx.is_modular_api()
1843+
&& !uses_proxy_server
18291844
&& !matches!(
18301845
walker.item.elem.provider,
18311846
internal_llm_client::ClientProvider::AwsBedrock

0 commit comments

Comments
 (0)