mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-14 01:36:02 +08:00
Merge branch 'nsc/__experimental_streamSteps'
This commit is contained in:
commit
23d3257a57
@ -54,6 +54,19 @@ export async function updateExtract(
|
|||||||
extract.steps = [...current.steps, ...extract.steps];
|
extract.steps = [...current.steps, ...extract.steps];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Limit links in steps to 500
|
||||||
|
if (extract.steps) {
|
||||||
|
extract.steps = extract.steps.map(step => {
|
||||||
|
if (step.discoveredLinks && step.discoveredLinks.length > 500) {
|
||||||
|
return {
|
||||||
|
...step,
|
||||||
|
discoveredLinks: step.discoveredLinks.slice(0, 500)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return step;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
await redisConnection.set(
|
await redisConnection.set(
|
||||||
"extract:" + id,
|
"extract:" + id,
|
||||||
JSON.stringify({ ...current, ...extract }),
|
JSON.stringify({ ...current, ...extract }),
|
||||||
|
@ -256,7 +256,7 @@ export async function performExtraction(
|
|||||||
step: ExtractStep.MULTI_ENTITY_SCRAPE,
|
step: ExtractStep.MULTI_ENTITY_SCRAPE,
|
||||||
startedAt: Date.now(),
|
startedAt: Date.now(),
|
||||||
finishedAt: Date.now(),
|
finishedAt: Date.now(),
|
||||||
discoveredLinks: [],
|
discoveredLinks: links,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
@ -510,7 +510,7 @@ export async function performExtraction(
|
|||||||
step: ExtractStep.EXTRACT,
|
step: ExtractStep.EXTRACT,
|
||||||
startedAt: Date.now(),
|
startedAt: Date.now(),
|
||||||
finishedAt: Date.now(),
|
finishedAt: Date.now(),
|
||||||
discoveredLinks: [],
|
discoveredLinks: links,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user