@@ -281,10 +281,10 @@ impl ChatArgs {
281
281
// If modelId is specified, verify it exists before starting the chat
282
282
let model_id: Option < String > = if let Some ( model_name) = self . model {
283
283
let model_name_lower = model_name. to_lowercase ( ) ;
284
- match MODEL_OPTIONS . iter ( ) . find ( |( _ , name, _) | name == & model_name_lower) {
285
- Some ( ( _, _ , id) ) => Some ( ( * id) . to_string ( ) ) ,
284
+ match MODEL_OPTIONS . iter ( ) . find ( |( name, _) | name == & model_name_lower) {
285
+ Some ( ( _, id) ) => Some ( ( * id) . to_string ( ) ) ,
286
286
None => {
287
- let available_names: Vec < & str > = MODEL_OPTIONS . iter ( ) . map ( |( _ , name, _) | * name) . collect ( ) ;
287
+ let available_names: Vec < & str > = MODEL_OPTIONS . iter ( ) . map ( |( name, _) | * name) . collect ( ) ;
288
288
bail ! (
289
289
"Model '{}' does not exist. Available models: {}" ,
290
290
model_name,
@@ -436,19 +436,11 @@ const ROTATING_TIPS: [&str; 14] = [
436
436
color_print:: cstr! { "Customize your current chat session by choosing a model with <green!>/model</green!>" } ,
437
437
] ;
438
438
439
- pub const MODEL_OPTIONS : [ ( & str , & str , & str ) ; 3 ] = [
439
+ pub const MODEL_OPTIONS : [ ( & str , & str ) ; 3 ] = [
440
440
// ("Auto", ""),
441
- (
442
- "Claude Sonnet 3.5" ,
443
- "claude-3.5-sonnet" ,
444
- "CLAUDE_3_5_SONNET_20241022_V2_0" ,
445
- ) ,
446
- (
447
- "Claude Sonnet 3.7" ,
448
- "claude-3.7-sonnet" ,
449
- "CLAUDE_3_7_SONNET_20250219_V1_0" ,
450
- ) ,
451
- ( "Claude Sonnet 4.0" , "claude-4-sonnet" , "CLAUDE_SONNET_4_20250514_V1_0" ) ,
441
+ ( "claude-3.5-sonnet" , "CLAUDE_3_5_SONNET_20241022_V2_0" ) ,
442
+ ( "claude-3.7-sonnet" , "CLAUDE_3_7_SONNET_20250219_V1_0" ) ,
443
+ ( "claude-4-sonnet" , "CLAUDE_SONNET_4_20250514_V1_0" ) ,
452
444
] ;
453
445
454
446
pub const DEFAULT_MODEL_ID : & str = "CLAUDE_3_7_SONNET_20250219_V1_0" ;
@@ -617,8 +609,8 @@ impl ChatContext {
617
609
. and_then ( |model_name| {
618
610
MODEL_OPTIONS
619
611
. iter ( )
620
- . find ( |( _ , name, _) | * name == model_name)
621
- . map ( |( _, _ , id) | ( * id) . to_owned ( ) )
612
+ . find ( |( name, _) | * name == model_name)
613
+ . map ( |( _, id) | ( * id) . to_owned ( ) )
622
614
} )
623
615
. or_else ( || Some ( DEFAULT_MODEL_ID . to_owned ( ) ) ) ,
624
616
} ;
@@ -3124,7 +3116,7 @@ impl ChatContext {
3124
3116
let active_model_id = self . conversation_state . current_model_id . as_deref ( ) ;
3125
3117
let labels: Vec < String > = MODEL_OPTIONS
3126
3118
. iter ( )
3127
- . map ( |( label, _ , model_id) | {
3119
+ . map ( |( label, model_id) | {
3128
3120
if ( model_id. is_empty ( ) && active_model_id. is_none ( ) ) || Some ( * model_id) == active_model_id {
3129
3121
format ! ( "{} (active)" , label)
3130
3122
} else {
@@ -3134,7 +3126,7 @@ impl ChatContext {
3134
3126
. collect ( ) ;
3135
3127
let default_index = MODEL_OPTIONS
3136
3128
. iter ( )
3137
- . position ( |( _, _ , model_id) | Some ( * model_id) == active_model_id)
3129
+ . position ( |( _, model_id) | Some ( * model_id) == active_model_id)
3138
3130
. unwrap_or ( 0 ) ;
3139
3131
let selection: Option < _ > = match Select :: with_theme ( & crate :: util:: dialoguer_theme ( ) )
3140
3132
. with_prompt ( "Select a model for this chat session" )
@@ -3157,7 +3149,7 @@ impl ChatContext {
3157
3149
queue ! ( self . output, style:: ResetColor ) ?;
3158
3150
3159
3151
if let Some ( index) = selection {
3160
- let ( label, _ , model_id) = MODEL_OPTIONS [ index] ;
3152
+ let ( label, model_id) = MODEL_OPTIONS [ index] ;
3161
3153
let model_id_str = model_id. to_string ( ) ;
3162
3154
self . conversation_state . current_model_id = Some ( model_id_str. clone ( ) ) ;
3163
3155
telemetry. update_model_id ( Some ( model_id_str. clone ( ) ) ) ;
0 commit comments