MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / is_gpt5_or_later

Function is_gpt5_or_later

crates/opencode-provider/src/bootstrap.rs:93–103  ·  view source on GitHub ↗

Check if a model ID represents GPT-5 or later.

(model_id: &str)

Source from the content-addressed store, hash-verified

91
92/// Check if a model ID represents GPT-5 or later.
93pub 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.
106pub fn should_use_copilot_responses_api(model_id: &str) -> bool {

Callers 1

Calls 3

newFunction · 0.85
getMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected