Skip to content

Commit

Permalink
Merge pull request #6 from ovstinga/03-spawn-a
Browse files Browse the repository at this point in the history
Make chatbot::query_chat compute intensive
  • Loading branch information
ovstinga authored Dec 20, 2024
2 parents a73d70d + 9ee2e28 commit 4f69cfb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/chatbot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> {
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?"),
Expand Down

0 comments on commit 4f69cfb

Please sign in to comment.