| ... | ... | @@ -109,6 +109,8 @@ fn ai_profile(model: Option<&str>) -> Profile { |
| 109 | 109 | (rest, include_str!("openai.svg"), true) |
| 110 | 110 | } else if id.starts_with("qwen") { |
| 111 | 111 | (id, include_str!("qwen.svg"), false) |
| 112 | } else if id.starts_with("gemini-") { |
| 113 | (id, include_str!("google.svg"), false) |
| 112 | 114 | } else { |
| 113 | 115 | (id, include_str!("bot.svg"), false) |
| 114 | 116 | }; |
| ... | ... | @@ -287,7 +289,10 @@ fn rewrite(html: &str, origin: &url::Url, profiles: &HashMap<String, Profile>, a |
| 287 | 289 | } |
| 288 | 290 | let name = if compact.get() && profile.owner.is_some() { |
| 289 | 291 | let number = profile.name.find(|c: char| c.is_ascii_digit()).unwrap_or(profile.name.len()); |
| 290 | | profile.name[..number].trim_end_matches([' ', '-']) |
| 292 | match profile.name.strip_prefix("Gemini ").and_then(|rest| rest.split_once(' ')) { |
| 293 | Some((_, variant)) => variant, |
| 294 | None => profile.name[..number].trim_end_matches([' ', '-']), |
| 295 | } |
| 291 | 296 | } else { &profile.name }; |
| 292 | 297 | element.append(name, ContentType::Text); |
| 293 | 298 | if profile.url.is_some() { element.append("</span>", ContentType::Html); } |
| ... | ... | @@ -666,6 +671,8 @@ mod tests { |
| 666 | 671 | ("qwen3.8-27b", "Qwen 3.8 27b"), |
| 667 | 672 | ("big-pickle-2", "Big Pickle 2"), |
| 668 | 673 | ("llama-3-70", "Llama 3 70"), |
| 674 | ("gemini-4-neon", "Gemini 4 Neon"), |
| 675 | ("gemini-4-hydrogen", "Gemini 4 Hydrogen"), |
| 669 | 676 | ] { assert_eq!(ai_profile(Some(id)).name, name, "{id}"); } |
| 670 | 677 | } |
| 671 | 678 | |
| ... | ... | @@ -693,7 +700,7 @@ mod tests { |
| 693 | 700 | assert_eq!(image.attr("alt"), Some("")); |
| 694 | 701 | } |
| 695 | 702 | assert!(output.contains("<div class='markdown'><img src='https://api.dicebear.com/10.x/line-face/svg?seed=native-clover'>")); |
| 696 | | for (model, short) in [("qwen3.8-27b", "Qwen"), ("big-pickle-2", "Big Pickle"), ("claude-new-variant-5-5", "New Variant")] { |
| 703 | for (model, short) in [("qwen3.8-27b", "Qwen"), ("big-pickle-2", "Big Pickle"), ("claude-new-variant-5-5", "New Variant"), ("gemini-4-neon", "Neon"), ("gemini-4-carbon", "Carbon"), ("gemini-4", "Gemini")] { |
| 697 | 704 | let mut profile = ai_profile(Some(model)); |
| 698 | 705 | profile.owner = Some(("clover".into(), None)); |
| 699 | 706 | let profiles = HashMap::from([("ai-model".into(), profile)]); |