From 68d5c66d3e70c8d9a2a50764faf3c11df3792aea Mon Sep 17 00:00:00 2001 From: Roger Zurawicki Date: Wed, 14 Jun 2023 19:28:42 -0400 Subject: [PATCH] Adjust timeouts --- src/cli.rs | 2 +- src/prompt.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index 4d54a73..efde547 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -60,7 +60,7 @@ pub(crate) async fn main() -> anyhow::Result<()> { .init(); let backoff = backoff::ExponentialBackoffBuilder::new() - .with_max_elapsed_time(Some(std::time::Duration::from_secs(60))) + .with_max_elapsed_time(Some(std::time::Duration::from_secs(5 * 60))) .build(); let api_key = if let Ok(api_key) = std::env::var("OPENAI_API_KEY") { diff --git a/src/prompt.rs b/src/prompt.rs index d825c8d..5961bbb 100644 --- a/src/prompt.rs +++ b/src/prompt.rs @@ -66,7 +66,7 @@ pub(crate) async fn chat_completion( }); } Err(e) => { - bail!("{e}"); + bail!(e); } } } @@ -114,7 +114,7 @@ pub(crate) async fn completion( Ok(ccr) => ccr.choices.iter().for_each(|c| { print!("{}", c.text); }), - Err(e) => bail!("{e}"), + Err(e) => bail!(e), } } println!();