MCPcopy Create free account
hub / github.com/AI45Lab/Code / first_non_empty_env

Function first_non_empty_env

core/src/llm/http.rs:300–307  ·  view source on GitHub ↗
(keys: &[&str])

Source from the content-addressed store, hash-verified

298}
299
300fn first_non_empty_env(keys: &[&str]) -> Option<String> {
301 keys.iter().find_map(|key| {
302 env::var(key)
303 .ok()
304 .map(|value| value.trim().to_string())
305 .filter(|value| !value.is_empty())
306 })
307}
308
309/// Normalize base URL by stripping trailing /v1
310pub(crate) fn normalize_base_url(base_url: &str) -> String {

Callers 1

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected