Skip to content

Commit 4e36d04

Browse files
committed
feat(cli): show model name in chat header, remove provider from prompt
1 parent 21a2a7c commit 4e36d04

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

crates/rullm-cli/src/commands/chat/interactive.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ pub async fn run_interactive_chat(
1616
use super::{ChatPrompt, setup_reedline};
1717

1818
println!(
19-
"{} {} {}",
19+
"{} {}/{}",
2020
"Interactive chat with".green(),
2121
client.provider_name().blue().bold(),
22-
"(Ctrl+C to exit)".dimmed()
22+
client.model_name().blue().bold(),
2323
);
2424
println!(
2525
"{} Type {} for available commands.",
@@ -32,11 +32,11 @@ pub async fn run_interactive_chat(
3232
"exit".yellow(),
3333
"quit".yellow()
3434
);
35-
println!("");
35+
println!();
3636

3737
let mut conversation = Vec::new();
3838
let mut line_editor = setup_reedline(config.config.vi_mode, &config.data_base_path)?;
39-
let prompt = ChatPrompt::new(client.provider_name().to_string());
39+
let prompt = ChatPrompt::new();
4040

4141
// Track Ctrl+C presses for double-press exit
4242
let mut last_ctrl_c: Option<Instant> = None;

crates/rullm-cli/src/commands/chat/prompt.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@ use std::borrow::Cow;
44

55
#[derive(Clone)]
66
pub struct ChatPrompt {
7-
pub provider_name: String,
87
pub multiline_mode: bool,
98
}
109

1110
impl ChatPrompt {
12-
pub(crate) fn new(provider_name: String) -> Self {
11+
pub(crate) fn new() -> Self {
1312
Self {
14-
provider_name,
1513
multiline_mode: false,
1614
}
1715
}
@@ -27,11 +25,7 @@ impl Prompt for ChatPrompt {
2725
}
2826

2927
fn render_prompt_right(&self) -> Cow<str> {
30-
if self.multiline_mode {
31-
Cow::Borrowed("")
32-
} else {
33-
Cow::Owned(format!("[{}]", self.provider_name.blue()))
34-
}
28+
Cow::Borrowed("")
3529
}
3630

3731
fn render_prompt_indicator(&self, edit_mode: PromptEditMode) -> Cow<str> {

crates/rullm-core/src/simple.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,15 @@ impl SimpleLlmClient {
804804
| SimpleLlmClient::Google { config, .. } => config,
805805
}
806806
}
807+
808+
/// Returns the model name used by this client (the default model for the provider)
809+
pub fn model_name(&self) -> &str {
810+
match self {
811+
SimpleLlmClient::OpenAI { config, .. } => &config.default_models.openai,
812+
SimpleLlmClient::Anthropic { config, .. } => &config.default_models.anthropic,
813+
SimpleLlmClient::Google { config, .. } => &config.default_models.google,
814+
}
815+
}
807816
}
808817

809818
#[cfg(test)]

0 commit comments

Comments
 (0)