MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / discover_existing

Method discover_existing

crates/openshell-providers/src/providers/vertex.rs:26–42  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

24 }
25
26 fn discover_existing(&self) -> Result<Option<DiscoveredProvider>, ProviderError> {
27 let mut discovered = discover_with_spec(&SPEC, &RealDiscoveryContext)?.unwrap_or_default();
28
29 for key in inference::VERTEX_AI_CONFIG_KEY_NAMES {
30 if let Ok(val) = std::env::var(key)
31 && !val.trim().is_empty()
32 {
33 discovered.config.entry(key.to_string()).or_insert(val);
34 }
35 }
36
37 if discovered.is_empty() {
38 Ok(None)
39 } else {
40 Ok(Some(discovered))
41 }
42 }
43
44 fn credential_env_vars(&self) -> &'static [&'static str] {
45 SPEC.credential_env_vars

Callers

nothing calls this directly

Calls 2

discover_with_specFunction · 0.85
is_emptyMethod · 0.45

Tested by

no test coverage detected