diff options
| author | sigoden <sigoden@gmail.com> | 2024-06-13 19:41:54 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-13 19:41:54 +0800 |
| commit | f9847475b8eae99a70f16dc63bac67da2632474a (patch) | |
| tree | 032c9eb02540cf8644a2df103d8a45dfc54557be /src/config/bot.rs | |
| parent | 255b194bcc538b2557caa60c5b607b4c4bfc0abd (diff) | |
| download | aichat-f9847475b8eae99a70f16dc63bac67da2632474a.tar.gz | |
feat: add rag and bot related cli options (#595)
Diffstat (limited to 'src/config/bot.rs')
| -rw-r--r-- | src/config/bot.rs | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/config/bot.rs b/src/config/bot.rs index e1e1df6..e02cce7 100644 --- a/src/config/bot.rs +++ b/src/config/bot.rs @@ -53,22 +53,14 @@ impl Bot { None => config.current_model().clone(), } }; - let rag = if rag_path.exists() { Some(Arc::new(Rag::load(config, "rag", &rag_path)?)) } else if embeddings_dir.is_dir() { - println!("The bot has an embeddings directory, RAG is initializing..."); - let ans = Confirm::new("The bot attached embeddings, init RAG?") - .with_default(true) - .prompt()?; - if ans { - let doc_path = embeddings_dir.display().to_string(); - Some(Arc::new( - Rag::init(config, "rag", &rag_path, &[doc_path], abort_signal).await?, - )) - } else { - None - } + println!("The bot uses an embeddings directory, initializing RAG..."); + let doc_path = embeddings_dir.display().to_string(); + Some(Arc::new( + Rag::init(config, "rag", &rag_path, &[doc_path], abort_signal).await?, + )) } else { None }; @@ -121,7 +113,7 @@ impl Bot { self.rag.clone() } - pub fn converstaion_staters(&self) -> &[String] { + pub fn conversation_staters(&self) -> &[String] { &self.definition.conversation_starters } } |
