Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

Update scrape.ts

Eric Ciarlae1af815f8ce3
diff --git a/apps/api/src/controllers/scrape.ts b/apps/api/src/controllers/scrape.ts
index 56ea1d5d8..f5e2c3229 100644
--- a/apps/api/src/controllers/scrape.ts
+++ b/apps/api/src/controllers/scrape.ts
@@ -65,8 +65,9 @@ export async function scrapeHelper(
return { success: true, error: "No page found", returnCode: 200, data: docs[0] };
}
- // Remove rawHtml if pageOptions.rawHtml is false
- if (!pageOptions.includeRawHtml) {
+
+ // Remove rawHtml if pageOptions.rawHtml is false and extractorOptions.mode is llm-extraction-from-raw-html
+ if (!pageOptions.includeRawHtml && extractorOptions.mode == "llm-extraction-from-raw-html") {
filteredDocs.forEach(doc => {
delete doc.rawHtml;
});