INNER CODE UNIT · TypeScript
attemptFirecrawl
steipete/summarize · packages/core/src/content/link-preview/content/index.ts:136
const attemptFirecrawl = async (reason: string): Promise<ExtractedLinkContent | null> => {
if (!canUseFirecrawl) {
return null;
}
if (!firecrawlAttempted) {
const attempt = await fetchWithFirecrawl(url, deps.scrapeWithFirecrawl, {
timeoutMs,
cacheMode,
onProgress: deps.onProgress ?? null,
reason,
});
firecrawlAttempted = true;
firecrawlPayload = attempt.payload;
firecrawlDiagnostics.attempted = attempt.diagnostics.attempted;
firecrawlDiagnostics.used = attempt.diagnostics.used;
firecrawlDiagnostics.cacheMode = attempt.diagnostics.cacheMode;
firecrawlDiagnostics.cacheStatus = attempt.diagnostics.cacheStatus;