Skip to content

Commit f6d48b7

Browse files
committed
remove model id mapping in client
1 parent 3d3be47 commit f6d48b7

File tree

2 files changed

+9
-31
lines changed

2 files changed

+9
-31
lines changed

crates/chat-cli/src/cli/chat/cli/model.rs

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,10 @@ pub async fn select_model(os: &mut Os, session: &mut ChatSession) -> Result<Opti
5757
let labels: Vec<String> = models
5858
.iter()
5959
.map(|model| {
60-
let display_name = get_display_name(model.model_id());
6160
if Some(model.model_id()) == active_model_id {
62-
format!("{} (active)", display_name)
61+
format!("{} (active)", model.model_id())
6362
} else {
64-
display_name.to_owned()
63+
model.model_id().to_owned()
6564
}
6665
})
6766
.collect();
@@ -89,13 +88,12 @@ pub async fn select_model(os: &mut Os, session: &mut ChatSession) -> Result<Opti
8988
if let Some(index) = selection {
9089
let selected = &models[index];
9190
let model_id_str = selected.model_id.clone();
92-
session.conversation.model = Some(model_id_str);
93-
let display_name = get_display_name(selected.model_id());
91+
session.conversation.model = Some(model_id_str.clone());
9492

9593
queue!(
9694
session.stderr,
9795
style::Print("\n"),
98-
style::Print(format!(" Using {}\n\n", display_name)),
96+
style::Print(format!(" Using {}\n\n", model_id_str)),
9997
style::ResetColor,
10098
style::SetForegroundColor(Color::Reset),
10199
style::SetBackgroundColor(Color::Reset),
@@ -129,15 +127,3 @@ pub async fn default_model_id(os: &Os) -> String {
129127
// Default to 4.0
130128
"CLAUDE_SONNET_4_20250514_V1_0".to_string()
131129
}
132-
133-
pub fn get_display_name(model_id: &str) -> &str {
134-
match model_id {
135-
"CLAUDE_SONNET_4_20250514_V1_0" => "claude-4-sonnet",
136-
"CLAUDE_3_7_SONNET_20250219_V1_0" => "claude-3.7-sonnet",
137-
"CLAUDE_3_5_SONNET_20240620_V1_0" => "claude-3.5-sonnet-v1",
138-
"CLAUDE_3_5_SONNET_20241022_V2_0" => "claude-3.5-sonnet-v2",
139-
"CLAUDE_3_5_HAIKU_20241022_V1_0" => "claude-3.5-haiku",
140-
"NOVA_PRO_V1_0" => "nova-pro",
141-
_ => model_id,
142-
}
143-
}

crates/chat-cli/src/cli/chat/mod.rs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,7 @@ use crate::auth::AuthError;
128128
use crate::auth::builder_id::is_idc_user;
129129
use crate::cli::agent::Agents;
130130
use crate::cli::chat::cli::SlashCommand;
131-
use crate::cli::chat::cli::model::{
132-
default_model_id,
133-
get_display_name,
134-
};
131+
use crate::cli::chat::cli::model::default_model_id;
135132
use crate::cli::chat::cli::prompts::{
136133
GetPromptError,
137134
PromptsSubcommand,
@@ -298,21 +295,17 @@ impl ChatArgs {
298295
{
299296
Some(m.model_id.clone())
300297
} else {
301-
let available = models
302-
.iter()
303-
.map(|m| get_display_name(m.model_id()).to_string())
304-
.collect::<Vec<_>>()
305-
.join(", ");
298+
let available = models.iter().map(|m| m.model_id.clone()).collect::<Vec<_>>().join(", ");
306299
bail!("Model '{}' does not exist. Available models: {}", requested, available);
307300
}
308301
} else if let Some(saved) = os
309302
.database
310303
.settings
311304
.get_string(Setting::ChatDefaultModel)
312-
.and_then(|name| {
305+
.and_then(|model_id| {
313306
models
314307
.iter()
315-
.find(|m| get_display_name(m.model_id()) == name)
308+
.find(|m| m.model_id() == model_id)
316309
.map(|m| m.model_id.clone())
317310
})
318311
{
@@ -1165,11 +1158,10 @@ impl ChatSession {
11651158
self.stderr.flush()?;
11661159

11671160
if let Some(ref id) = self.conversation.model {
1168-
let display_name = get_display_name(id);
11691161
execute!(
11701162
self.stderr,
11711163
style::SetForegroundColor(Color::Cyan),
1172-
style::Print(format!("🤖 You are chatting with {}\n", display_name)),
1164+
style::Print(format!("🤖 You are chatting with {}\n", id)),
11731165
style::SetForegroundColor(Color::Reset),
11741166
style::Print("\n")
11751167
)?;

0 commit comments

Comments
 (0)