From 9ee2e28ed6eb309b188684cd28d9925b5ffca154 Mon Sep 17 00:00:00 2001 From: Will Crichton Date: Wed, 31 Jul 2024 14:16:22 -0700 Subject: [PATCH] Make chatbot::query_chat compute intensive --- crates/chatbot/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/chatbot/src/lib.rs b/crates/chatbot/src/lib.rs index 9506250..8415b7f 100644 --- a/crates/chatbot/src/lib.rs +++ b/crates/chatbot/src/lib.rs @@ -22,7 +22,7 @@ pub async fn gen_random_number() -> usize { /// /// Warning: may take a few seconds! pub async fn query_chat(messages: &[String]) -> Vec { - tokio::time::sleep(Duration::from_secs(2)).await; + std::thread::sleep(Duration::from_secs(2)); let most_recent = messages.last().unwrap(); vec![ format!("\"{most_recent}\"? And how does that make you feel?"),