mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-03 04:20:38 +08:00
feat(extractSmartScrape): mog it to 100 pages max
This commit is contained in:
parent
129b10e478
commit
dcef6fbc13
@ -279,10 +279,18 @@ export async function extractData({
|
|||||||
smartScrapeCost += smartscrapeResults[0].tokenUsage;
|
smartScrapeCost += smartscrapeResults[0].tokenUsage;
|
||||||
smartScrapeCallCount++;
|
smartScrapeCallCount++;
|
||||||
} else {
|
} else {
|
||||||
const pages = extract?.smartscrapePages;
|
const pages = extract?.smartscrapePages ?? [];
|
||||||
//do it async promiseall instead
|
//do it async promiseall instead
|
||||||
|
if (pages.length > 100) {
|
||||||
|
logger.warn("Smart scrape pages limit exceeded, only first 100 pages will be scraped", {
|
||||||
|
pagesLength: pages.length,
|
||||||
|
extractId,
|
||||||
|
scrapeId,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
smartscrapeResults = await Promise.all(
|
smartscrapeResults = await Promise.all(
|
||||||
pages.map(async (page) => {
|
pages.slice(0, 100).map(async (page) => {
|
||||||
return await smartScrape(
|
return await smartScrape(
|
||||||
urls[page.page_index],
|
urls[page.page_index],
|
||||||
page.smartscrape_prompt,
|
page.smartscrape_prompt,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user