Skip to content

Commit

Permalink
πŸ‘Œ IMPROVE: Rate limit handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadbilaldev committed Dec 13, 2024
1 parent 30f0df7 commit 2224a22
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/baseai/src/deploy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ export async function uploadDocumentsToMemory({
account: Account;
}) {
const BATCH_SIZE = 5; // Number of concurrent uploads
const RATE_LIMIT_DELAY = 1000; // 1 second delay between requests
const RATE_LIMIT_DELAY = 1500; // 1.5 second delay between requests

// Process documents in batches to avoid rate limiting
for (let i = 0; i < documents.length; i += BATCH_SIZE) {
Expand Down Expand Up @@ -732,7 +732,7 @@ export async function deleteDocumentsFromMemory({
account: Account;
}) {
const BATCH_SIZE = 5; // Number of concurrent uploads
const RATE_LIMIT_DELAY = 1000; // 1 second delay between requests
const RATE_LIMIT_DELAY = 1500; // 1.5 second delay between requests

p.log.info(`Deleting ${documents.length} documents from memory: ${name}`);

Expand Down Expand Up @@ -1165,7 +1165,7 @@ export async function handleGitSyncMemoryDeploy({
overwrite: boolean;
}) {
const BATCH_SIZE = 5;
const RATE_LIMIT_DELAY = 1000;
const RATE_LIMIT_DELAY = 1500;

// Fetch existing documents once
const prodDocs = await listMemoryDocuments({
Expand Down

0 comments on commit 2224a22

Please sign in to comment.