Skip to content

Commit 06e5441

Browse files
authored
Merge pull request #101 from brightdata/feat/batch-sizes
feat: reduce batch size
2 parents cac64d5 + a1562bb commit 06e5441

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

server.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ addTool({
269269
.default('google'),
270270
cursor: z.string()
271271
.optional(),
272-
})).min(1).max(10),
272+
})).min(1).max(5),
273273
}),
274274
execute: tool_fn('search_engine_batch', async ({queries}, ctx)=>{
275275
const search_promises = queries.map(({query, engine, cursor})=>{
@@ -313,7 +313,7 @@ addTool({
313313
});
314314
});
315315

316-
const results = await Promise.all(search_promises);
316+
const results = await Promise.allSettled(search_promises);
317317
return JSON.stringify(results, null, 2);
318318
}),
319319
});
@@ -330,7 +330,7 @@ addTool({
330330
openWorldHint: true,
331331
},
332332
parameters: z.object({
333-
urls: z.array(z.string().url()).min(1).max(10).describe('Array of URLs to scrape (max 10)')
333+
urls: z.array(z.string().url()).min(1).max(5).describe('Array of URLs to scrape (max 5)')
334334
}),
335335
execute: tool_fn('scrape_batch', async ({urls}, ctx)=>{
336336
const scrapePromises = urls.map(url =>
@@ -351,7 +351,7 @@ addTool({
351351
}))
352352
);
353353

354-
const results = await Promise.all(scrapePromises);
354+
const results = await Promise.allSettled(scrapePromises);
355355
return JSON.stringify(results, null, 2);
356356
}),
357357
});

0 commit comments

Comments
 (0)