Resolve the Vertex AI API host and normalized location from a configured region.
(region: &str)
| 361 | |
| 362 | /// Resolve the Vertex AI API host and normalized location from a configured region. |
| 363 | fn 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. |
no test coverage detected