From 1ef97b2f32caecdb2eef9fe3755390f36d96eae5 Mon Sep 17 00:00:00 2001 From: sigoden Date: Thu, 16 Mar 2023 17:02:09 +0800 Subject: feat: support multiple models (#71) --- src/repl/mod.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/repl/mod.rs') 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 \n\n"), + }, ".role" => match args { Some(name) => handler.handle(ReplCmd::SetRole(name.to_string()))?, None => print_now!("Usage: .role \n\n"), -- cgit v1.2.3