Infer the Vertex AI publisher segment from a model identifier. Currently only the `"anthropic"` result is consumed by `resolve_vertex_ai_route` to select between the native Anthropic Messages API (`rawPredict`) and the OpenAI-compatible endpoint. Non-Anthropic publisher mappings (`meta`, `mistralai`, `ai21`, `deepseek`, `google`) are maintained for forward compatibility and documentation value —
(model_id: &str)
| 278 | /// fall back to the OpenAI-compatible endpoint |
| 279 | /// (`v1beta1/.../endpoints/openapi`). |
| 280 | fn infer_vertex_publisher(model_id: &str) -> Option<&'static str> { |
| 281 | if model_id.starts_with("claude-") { |
| 282 | Some("anthropic") |
| 283 | } else if model_id.starts_with("gemini-") |
| 284 | || model_id.starts_with("text-bison-") |
| 285 | || model_id.starts_with("chat-bison-") |
| 286 | { |
| 287 | Some("google") |
| 288 | } else if model_id.starts_with("llama-") { |
| 289 | Some("meta") |
| 290 | } else if model_id.starts_with("mistral-") || model_id.starts_with("codestral-") { |
| 291 | Some("mistralai") |
| 292 | } else if model_id.starts_with("jamba-") { |
| 293 | Some("ai21") |
| 294 | } else if model_id.starts_with("deepseek-") { |
| 295 | Some("deepseek") |
| 296 | } else { |
| 297 | None |
| 298 | } |
| 299 | } |
| 300 | |
| 301 | /// Return a required Vertex AI config value, or a `FailedPrecondition` status. |
| 302 | fn required_vertex_config<'a>( |
no outgoing calls
no test coverage detected