From 3f9f742530cdb3f5684a22f4934cf3a949e74a58 Mon Sep 17 00:00:00 2001 From: KCaverly Date: Thu, 24 Aug 2023 11:45:52 +0200 Subject: [PATCH] update rate limiting embeddings strategy to delay less --- crates/semantic_index/src/embedding.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/semantic_index/src/embedding.rs b/crates/semantic_index/src/embedding.rs index 77457ec7f6..f2269a786a 100644 --- a/crates/semantic_index/src/embedding.rs +++ b/crates/semantic_index/src/embedding.rs @@ -106,8 +106,8 @@ impl OpenAIEmbeddings { #[async_trait] impl EmbeddingProvider for OpenAIEmbeddings { async fn embed_batch(&self, spans: Vec<&str>) -> Result>> { - const BACKOFF_SECONDS: [usize; 3] = [45, 75, 125]; - const MAX_RETRIES: usize = 3; + const BACKOFF_SECONDS: [usize; 4] = [3, 5, 15, 45]; + const MAX_RETRIES: usize = 4; let api_key = OPENAI_API_KEY .as_ref()