pub fn extract_model_name(model_string: &str) -> &strExpand description
Extract simple model name from a fully-qualified resource path.
If model_string matches the pattern
projects/{project}/locations/{location}/publishers/{publisher}/models/{model},
returns just the {model} portion. Otherwise returns model_string as-is.
ยงExamples
use gemini_adk_rs::utils::model_name::extract_model_name;
assert_eq!(
extract_model_name("projects/my-proj/locations/us-central1/publishers/google/models/gemini-2.5-flash"),
"gemini-2.5-flash"
);
assert_eq!(extract_model_name("gemini-2.5-flash"), "gemini-2.5-flash");