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

Function required_vertex_config

crates/openshell-server/src/inference.rs:302–313  ·  view source on GitHub ↗

Return a required Vertex AI config value, or a `FailedPrecondition` status.

(
    config: &'a std::collections::HashMap<String, String>,
    key: &str,
)

Source from the content-addressed store, hash-verified

300
301/// Return a required Vertex AI config value, or a `FailedPrecondition` status.
302fn required_vertex_config<'a>(
303 config: &'a std::collections::HashMap<String, String>,
304 key: &str,
305) -> Result<&'a str, Status> {
306 config
307 .get(key)
308 .map(String::as_str)
309 .filter(|v| !v.trim().is_empty())
310 .ok_or_else(|| {
311 Status::failed_precondition(format!("Vertex AI provider requires {key} config"))
312 })
313}
314
315/// Validate a GCP project ID against the documented format.
316///

Callers 1

resolve_vertex_ai_routeFunction · 0.85

Calls 2

getMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected