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 48de7b6 commit e3a6936
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 @@ -645,7 +645,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 @@ -693,7 +693,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 @@ -1123,7 +1123,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 e3a6936

Please sign in to comment.