From 255b194bcc538b2557caa60c5b607b4c4bfc0abd Mon Sep 17 00:00:00 2001 From: sigoden Date: Thu, 13 Jun 2024 07:41:29 +0800 Subject: feat: add `.starter` repl command (#594) --- src/config/mod.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/config/mod.rs') diff --git a/src/config/mod.rs b/src/config/mod.rs index 7e5d6cf..b1eb41f 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -918,7 +918,15 @@ impl Config { if let Some(bot) = &self.bot { bot.export() } else { - bail!("No rag") + bail!("No bot") + } + } + + pub fn bot_banner(&self) -> Result { + if let Some(bot) = &self.bot { + Ok(bot.banner()) + } else { + bail!("No bot") } } @@ -1023,6 +1031,14 @@ impl Config { .collect(), ".rag" => self.list_rags().into_iter().map(|v| (v, None)).collect(), ".bot" => list_bots().into_iter().map(|v| (v, None)).collect(), + ".starter" => match &self.bot { + Some(bot) => bot + .converstaion_staters() + .iter() + .map(|v| (v.clone(), None)) + .collect(), + None => vec![], + }, ".set" => vec![ "max_output_tokens", "temperature", -- cgit v1.2.3