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

Function vertex_location_and_host

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

Resolve the Vertex AI API host and normalized location from a configured region.

(region: &str)

Source from the content-addressed store, hash-verified

361
362/// Resolve the Vertex AI API host and normalized location from a configured region.
363fn vertex_location_and_host(region: &str) -> (String, String) {
364 let location = region.trim().to_ascii_lowercase();
365 let host = match location.as_str() {
366 "global" => "aiplatform.googleapis.com".to_string(),
367 "us" | "eu" => format!("aiplatform.{location}.rep.googleapis.com"),
368 _ => format!("{location}-aiplatform.googleapis.com"),
369 };
370 (location, host)
371}
372
373/// Reject Bedrock model ids that would produce ambiguous or malformed
374/// upstream URL paths.

Callers 1

resolve_vertex_ai_routeFunction · 0.85

Calls 1

as_strMethod · 0.45

Tested by

no test coverage detected