diff options
| author | sigoden <sigoden@gmail.com> | 2024-06-17 17:03:28 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-17 17:03:28 +0800 |
| commit | 62b297e8bb09e257a61154afddc4017e48bd12f3 (patch) | |
| tree | b402281f625b304ad99ba392597f65d9fca0b21e /src/config/mod.rs | |
| parent | ff284779d9757c128acaf690ddf64a87a986e413 (diff) | |
| download | aichat-62b297e8bb09e257a61154afddc4017e48bd12f3.tar.gz | |
feat: add `.regenerate` repl command (#610)
Diffstat (limited to 'src/config/mod.rs')
| -rw-r--r-- | src/config/mod.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/config/mod.rs b/src/config/mod.rs index a27245d..cb510ef 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -933,8 +933,11 @@ impl Config { } pub fn exit_bot(&mut self) -> Result<()> { - self.rag.take(); - self.bot.take(); + if self.bot.take().is_some() { + self.exit_session()?; + self.rag.take(); + self.last_message = None; + } Ok(()) } |
