diff options
| author | sigoden <sigoden@gmail.com> | 2023-03-16 17:02:09 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-16 17:02:09 +0800 |
| commit | 1ef97b2f32caecdb2eef9fe3755390f36d96eae5 (patch) | |
| tree | 269d9504e5959d2ca161862e0935103adc84b393 /src/repl/mod.rs | |
| parent | 4a74f5cd72160585721dbce1e92c110125d046dd (diff) | |
| download | aichat-1ef97b2f32caecdb2eef9fe3755390f36d96eae5.tar.gz | |
feat: support multiple models (#71)
Diffstat (limited to 'src/repl/mod.rs')
| -rw-r--r-- | src/repl/mod.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/repl/mod.rs b/src/repl/mod.rs index 337afb3..663decb 100644 --- a/src/repl/mod.rs +++ b/src/repl/mod.rs @@ -19,9 +19,10 @@ use reedline::Signal; use std::borrow::Cow; use std::sync::Arc; -pub const REPL_COMMANDS: [(&str, &str); 11] = [ +pub const REPL_COMMANDS: [(&str, &str); 12] = [ (".info", "Print the information"), (".set", "Modify the configuration temporarily"), + (".model", "Choose a model"), (".prompt", "Add a GPT prompt"), (".role", "Select a role"), (".clear role", "Clear the currently selected role"), @@ -109,6 +110,10 @@ impl Repl { self.editor.print_history()?; print_now!("\n"); } + ".model" => match args { + Some(name) => handler.handle(ReplCmd::SetModel(name.to_string()))?, + None => print_now!("Usage: .model <name>\n\n"), + }, ".role" => match args { Some(name) => handler.handle(ReplCmd::SetRole(name.to_string()))?, None => print_now!("Usage: .role <name>\n\n"), |
