summaryrefslogtreecommitdiffstats
path: root/src/config/bot.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-06-13 19:41:54 +0800
committerGitHub <noreply@github.com>2024-06-13 19:41:54 +0800
commitf9847475b8eae99a70f16dc63bac67da2632474a (patch)
tree032c9eb02540cf8644a2df103d8a45dfc54557be /src/config/bot.rs
parent255b194bcc538b2557caa60c5b607b4c4bfc0abd (diff)
downloadaichat-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.rs20
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
}
}