summaryrefslogtreecommitdiffstats
path: root/src/repl/handler.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2023-03-16 17:02:09 +0800
committerGitHub <noreply@github.com>2023-03-16 17:02:09 +0800
commit1ef97b2f32caecdb2eef9fe3755390f36d96eae5 (patch)
tree269d9504e5959d2ca161862e0935103adc84b393 /src/repl/handler.rs
parent4a74f5cd72160585721dbce1e92c110125d046dd (diff)
downloadaichat-1ef97b2f32caecdb2eef9fe3755390f36d96eae5.tar.gz
feat: support multiple models (#71)
Diffstat (limited to 'src/repl/handler.rs')
-rw-r--r--src/repl/handler.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/repl/handler.rs b/src/repl/handler.rs
index 159127c..014a851 100644
--- a/src/repl/handler.rs
+++ b/src/repl/handler.rs
@@ -12,6 +12,7 @@ use std::cell::RefCell;
pub enum ReplCmd {
Submit(String),
+ SetModel(String),
SetRole(String),
UpdateConfig(String),
Prompt(String),
@@ -65,6 +66,10 @@ impl ReplCmdHandler {
self.config.write().save_conversation(&input, &buffer)?;
*self.reply.borrow_mut() = buffer;
}
+ ReplCmd::SetModel(name) => {
+ self.config.write().set_model(&name)?;
+ print_now!("\n");
+ }
ReplCmd::SetRole(name) => {
let output = self.config.write().change_role(&name)?;
print_now!("{}\n\n", output.trim_end());