Check if a model ID represents GPT-5 or later.
(model_id: &str)
| 91 | |
| 92 | /// Check if a model ID represents GPT-5 or later. |
| 93 | pub fn is_gpt5_or_later(model_id: &str) -> bool { |
| 94 | static RE: Lazy<Regex> = Lazy::new(|| Regex::new(r"^gpt-(\d+)").unwrap()); |
| 95 | if let Some(caps) = RE.captures(model_id) { |
| 96 | if let Some(num) = caps.get(1) { |
| 97 | if let Ok(n) = num.as_str().parse::<u32>() { |
| 98 | return n >= 5; |
| 99 | } |
| 100 | } |
| 101 | } |
| 102 | false |
| 103 | } |
| 104 | |
| 105 | /// Determine whether to use the Copilot responses API for a given model. |
| 106 | pub fn should_use_copilot_responses_api(model_id: &str) -> bool { |
no test coverage detected