diff options
| author | sigoden <sigoden@gmail.com> | 2024-06-13 07:41:29 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-13 07:41:29 +0800 |
| commit | 255b194bcc538b2557caa60c5b607b4c4bfc0abd (patch) | |
| tree | 2a2995f7a33df2d3024f489de4435a06e94dcef8 /src/config/bot.rs | |
| parent | 64982b4510e38153885bfd0a78c250110b3e03c5 (diff) | |
| download | aichat-255b194bcc538b2557caa60c5b607b4c4bfc0abd.tar.gz | |
feat: add `.starter` repl command (#594)
Diffstat (limited to 'src/config/bot.rs')
| -rw-r--r-- | src/config/bot.rs | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/config/bot.rs b/src/config/bot.rs index fef61f2..e1e1df6 100644 --- a/src/config/bot.rs +++ b/src/config/bot.rs @@ -54,10 +54,6 @@ impl Bot { } }; - let render_options = config.read().render_options()?; - let mut markdown_render = MarkdownRender::init(render_options)?; - println!("{}", markdown_render.render(&definition.banner())); - let rag = if rag_path.exists() { Some(Arc::new(Rag::load(config, "rag", &rag_path)?)) } else if embeddings_dir.is_dir() { @@ -101,6 +97,10 @@ impl Bot { Ok(data) } + pub fn banner(&self) -> String { + self.definition.banner() + } + pub fn name(&self) -> &str { &self.name } @@ -120,6 +120,10 @@ impl Bot { pub fn rag(&self) -> Option<Arc<Rag>> { self.rag.clone() } + + pub fn converstaion_staters(&self) -> &[String] { + &self.definition.conversation_starters + } } impl RoleLike for Bot { @@ -227,14 +231,13 @@ impl BotDefinition { format!( r#" -**Conversation Starters** +## Conversation Starters {starters}"# ) }; format!( r#"# {name} {version} -{description}{starters} -"# +{description}{starters}"# ) } } |
