@@ -230,18 +230,21 @@ impl LLMProvider for OpenAIProvider {
230230
231231 fn characteristics ( & self ) -> ProviderCharacteristics {
232232 // Characteristics vary by model
233- let ( max_tokens, rpm_limit, tpm_limit, supports_functions) = match self . config . model . as_str ( ) {
234- // Reasoning models
235- m if m. contains ( "o1" ) => ( 200_000 , Some ( 50 ) , Some ( 30_000 ) , false ) ,
236- m if m. contains ( "o3" ) || m. contains ( "o4" ) => ( 200_000 , Some ( 50 ) , Some ( 30_000 ) , false ) ,
237- m if m. starts_with ( "gpt-5" ) => ( 200_000 , Some ( 50 ) , Some ( 30_000 ) , false ) ,
238- // Standard models
239- "gpt-4o" => ( 128_000 , Some ( 500 ) , Some ( 30_000 ) , true ) ,
240- "gpt-4o-mini" => ( 128_000 , Some ( 500 ) , Some ( 200_000 ) , true ) ,
241- "gpt-4-turbo" => ( 128_000 , Some ( 500 ) , Some ( 30_000 ) , true ) ,
242- "gpt-4" => ( 8_192 , Some ( 500 ) , Some ( 10_000 ) , true ) ,
243- _ => ( self . config . context_window , Some ( 500 ) , Some ( 30_000 ) , true ) ,
244- } ;
233+ let ( max_tokens, rpm_limit, tpm_limit, supports_functions) =
234+ match self . config . model . as_str ( ) {
235+ // Reasoning models
236+ m if m. contains ( "o1" ) => ( 200_000 , Some ( 50 ) , Some ( 30_000 ) , false ) ,
237+ m if m. contains ( "o3" ) || m. contains ( "o4" ) => {
238+ ( 200_000 , Some ( 50 ) , Some ( 30_000 ) , false )
239+ }
240+ m if m. starts_with ( "gpt-5" ) => ( 200_000 , Some ( 50 ) , Some ( 30_000 ) , false ) ,
241+ // Standard models
242+ "gpt-4o" => ( 128_000 , Some ( 500 ) , Some ( 30_000 ) , true ) ,
243+ "gpt-4o-mini" => ( 128_000 , Some ( 500 ) , Some ( 200_000 ) , true ) ,
244+ "gpt-4-turbo" => ( 128_000 , Some ( 500 ) , Some ( 30_000 ) , true ) ,
245+ "gpt-4" => ( 8_192 , Some ( 500 ) , Some ( 10_000 ) , true ) ,
246+ _ => ( self . config . context_window , Some ( 500 ) , Some ( 30_000 ) , true ) ,
247+ } ;
245248
246249 ProviderCharacteristics {
247250 max_tokens,
@@ -394,7 +397,11 @@ mod tests {
394397 ..Default :: default ( )
395398 } ;
396399 let provider = OpenAIProvider :: new ( config) . unwrap ( ) ;
397- assert ! ( provider. is_reasoning_model( ) , "Model {} should be detected as reasoning model" , model) ;
400+ assert ! (
401+ provider. is_reasoning_model( ) ,
402+ "Model {} should be detected as reasoning model" ,
403+ model
404+ ) ;
398405 }
399406 }
400407
@@ -408,7 +415,11 @@ mod tests {
408415 ..Default :: default ( )
409416 } ;
410417 let provider = OpenAIProvider :: new ( config) . unwrap ( ) ;
411- assert ! ( !provider. is_reasoning_model( ) , "Model {} should NOT be detected as reasoning model" , model) ;
418+ assert ! (
419+ !provider. is_reasoning_model( ) ,
420+ "Model {} should NOT be detected as reasoning model" ,
421+ model
422+ ) ;
412423 }
413424 }
414425}
0 commit comments