File tree Expand file tree Collapse file tree 3 files changed +15
-12
lines changed
rullm-cli/src/commands/chat Expand file tree Collapse file tree 3 files changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -16,10 +16,10 @@ pub async fn run_interactive_chat(
16
16
use super :: { ChatPrompt , setup_reedline} ;
17
17
18
18
println ! (
19
- "{} {} {}" ,
19
+ "{} {}/ {}" ,
20
20
"Interactive chat with" . green( ) ,
21
21
client. provider_name( ) . blue( ) . bold( ) ,
22
- "(Ctrl+C to exit)" . dimmed ( )
22
+ client . model_name ( ) . blue ( ) . bold ( ) ,
23
23
) ;
24
24
println ! (
25
25
"{} Type {} for available commands." ,
@@ -32,11 +32,11 @@ pub async fn run_interactive_chat(
32
32
"exit" . yellow( ) ,
33
33
"quit" . yellow( )
34
34
) ;
35
- println ! ( "" ) ;
35
+ println ! ( ) ;
36
36
37
37
let mut conversation = Vec :: new ( ) ;
38
38
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 ( ) ;
40
40
41
41
// Track Ctrl+C presses for double-press exit
42
42
let mut last_ctrl_c: Option < Instant > = None ;
Original file line number Diff line number Diff line change @@ -4,14 +4,12 @@ use std::borrow::Cow;
4
4
5
5
#[ derive( Clone ) ]
6
6
pub struct ChatPrompt {
7
- pub provider_name : String ,
8
7
pub multiline_mode : bool ,
9
8
}
10
9
11
10
impl ChatPrompt {
12
- pub ( crate ) fn new ( provider_name : String ) -> Self {
11
+ pub ( crate ) fn new ( ) -> Self {
13
12
Self {
14
- provider_name,
15
13
multiline_mode : false ,
16
14
}
17
15
}
@@ -27,11 +25,7 @@ impl Prompt for ChatPrompt {
27
25
}
28
26
29
27
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 ( "" )
35
29
}
36
30
37
31
fn render_prompt_indicator ( & self , edit_mode : PromptEditMode ) -> Cow < str > {
Original file line number Diff line number Diff line change @@ -804,6 +804,15 @@ impl SimpleLlmClient {
804
804
| SimpleLlmClient :: Google { config, .. } => config,
805
805
}
806
806
}
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
+ }
807
816
}
808
817
809
818
#[ cfg( test) ]
You can’t perform that action at this time.
0 commit comments