Use the same units

This commit is contained in:
Kerollmops 2025-06-10 10:28:06 +02:00
parent 6433e49882
commit 416fcf47f1
No known key found for this signature in database
GPG Key ID: F250A4C4E3AE5F5F

View File

@ -128,7 +128,8 @@ impl ChatCompletionSource {
/// Old OpenAI models use the system role while new ones use the developer role.
fn old_openai_model(model: &str) -> bool {
["gpt-3.5", "gpt-4", "gpt-4.1", "gpt-4.5", "gpt-4o", "chatgpt-4o"].iter().any(|old| {
model.starts_with(old) && model.chars().nth(old.len()).is_none_or(|last| last == '-')
model.starts_with(old)
&& model.chars().nth(old.chars().count()).is_none_or(|last| last == '-')
})
}