From ce426c3218160998ad73e8c6387004f1baf379b0 Mon Sep 17 00:00:00 2001 From: Micheal Smith Date: Tue, 5 Aug 2025 02:14:30 -0500 Subject: [PATCH] Added configurable bot instruction. --- src/main.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 180299b..270c344 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,6 +14,10 @@ mod command; mod qna; mod setup; +const DEFAULT_INSTRUCT: &'static str = +"You are a shady, yet helpful IRC bot. You try to give responses that can + be sent in a single IRC response according to the specification."; + #[tokio::main] async fn main() -> Result<()> { // Some error sprucing. @@ -40,9 +44,7 @@ async fn main() -> Result<()> { config .get_string("model") .wrap_err("model string missing.")?, - "You are a shady, yet helpful IRC bot. You try to give responses that can -be sent in a single IRC response according to the specification." - .to_string(), + config.get_string("instruct").unwrap_or_else(|_| DEFAULT_INSTRUCT.to_string()), ) .wrap_err("Couldn't initialize LLM handle.")?; let mut c = chat::new(&config, &handle).await?;