diff --git a/rustbot/src/audio.rs b/rustbot/src/audio.rs index fc46ccd..6132be7 100644 --- a/rustbot/src/audio.rs +++ b/rustbot/src/audio.rs @@ -79,6 +79,8 @@ pub async fn play( sink.append(source); } } - sink.sleep_until_end(); + if !sink.empty() { + sink.sleep_until_end(); + } Ok(()) } diff --git a/rustbot/src/cli.rs b/rustbot/src/cli.rs index 5b3746b..a1e0f92 100644 --- a/rustbot/src/cli.rs +++ b/rustbot/src/cli.rs @@ -16,8 +16,6 @@ pub struct App { #[derive(Args, Debug)] pub struct Prompt { - #[arg(long, default_value = DEFAULT_SYSTEM_PROMPT, help = "system prompt")] - pub system: Option, #[arg(long, default_value = DEFAULT_SEED_PROMPT, help = "instruction prompt")] pub seed: Option, } diff --git a/rustbot/src/main.rs b/rustbot/src/main.rs index e45e43c..43ec2fe 100644 --- a/rustbot/src/main.rs +++ b/rustbot/src/main.rs @@ -21,9 +21,7 @@ mod tts; async fn main() -> Result<()> { let args = cli::App::parse(); - let system_prompt = args.prompt.system.unwrap(); let seed_prompt = args.prompt.seed.unwrap(); - let prompt = system_prompt + "\n" + &seed_prompt; // NOTE: we could also add Stream::builder to the jet module // and instead of passing config we could build it by chaining methods. @@ -41,7 +39,7 @@ async fn main() -> Result<()> { let c = llm::Config { hist_size: args.llm.hist_size, model_name: args.llm.model_name, - seed_prompt: Some(prompt), + seed_prompt: Some(seed_prompt), ..llm::Config::default() }; let l = llm::LLM::new(c); diff --git a/rustbot/src/prelude.rs b/rustbot/src/prelude.rs index 33cb0d3..c5bde69 100644 --- a/rustbot/src/prelude.rs +++ b/rustbot/src/prelude.rs @@ -8,14 +8,14 @@ pub const BOT_NAME: &str = "rustbot"; pub const BOT_SUB_SUBJECT: &str = "rust"; pub const BOT_PUB_SUBJECT: &str = "go"; -pub const DEFAULT_SYSTEM_PROMPT: &str = "You are a Rust programming language expert \ +pub const DEFAULT_SEED_PROMPT: &str = "You are a Rust programming language expert \ and a helpful AI assistant trying to learn about Go programming language. \ You will answer questions ONLY about Rust and ONLY ask questions about Go. \ You do NOT explain how Go works. You are NOT Go expert! You ONLY compare Go \ to Rust. When you receive the response you will evaluate it from a Rust programmer \ point of view and ask followup questions about Go. NEVER use emojis in your answers! \ - Your answers must NOT be longer than 100 words!"; -pub const DEFAULT_SEED_PROMPT: &str = "Question: What is the biggest strength of Rust? + Your answers must NOT be longer than 100 words! \ + Question: What is the biggest strength of Rust? Assistant: Rust's biggest strength lies in its focus on safety, particularly memory \ safety, without sacrificing performance. Can you tell me what are some of the biggest \ strengths of Go that make it stand out from other programming languages?