Skip to content

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

fix: summary + fill out new params

Gergő Móricz07082a7e66e9
diff --git a/apps/api/requests/v2/scrape.requests.http b/apps/api/requests/v2/scrape.requests.http
index d2d6eeffb..160f80b1e 100644
--- a/apps/api/requests/v2/scrape.requests.http
+++ b/apps/api/requests/v2/scrape.requests.http
@@ -2,16 +2,45 @@
@baseUrl = http://localhost:3002
# @baseUrl = https://api.firecrawl.dev
+### Summary
+POST {{baseUrl}}/v2/scrape HTTP/1.1
+Authorization: Bearer {{$dotenv TEST_API_KEY}}
+content-type: application/json
+
+{
+ "url": "https://docs.firecrawl.dev",
+ "formats": ["summary"]
+}
-### Crawl
-# @name crawl
-POST {{baseUrl}}/v1/scrape HTTP/1.1
+### JSON
+POST {{baseUrl}}/v2/scrape HTTP/1.1
Authorization: Bearer {{$dotenv TEST_API_KEY}}
content-type: application/json
{
"url": "https://docs.firecrawl.dev",
- "formats": ["markdown"]
+ "formats": [{
+ "type": "json",
+ "schema": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ }
+ }
+ }
+ }]
}
+### Change Tracking
+POST {{baseUrl}}/v2/scrape HTTP/1.1
+Authorization: Bearer {{$dotenv TEST_API_KEY}}
+content-type: application/json
+{
+ "url": "https://docs.firecrawl.dev",
+ "formats": [{
+ "type": "changeTracking",
+ "modes": ["git-diff"]
+ }]
+}
diff --git a/apps/api/src/scraper/scrapeURL/transformers/llmExtract.ts b/apps/api/src/scraper/scrapeURL/transformers/llmExtract.ts
index 734962c42..99fc01545 100644
--- a/apps/api/src/scraper/scrapeURL/transformers/llmExtract.ts
+++ b/apps/api/src/scraper/scrapeURL/transformers/llmExtract.ts
@@ -811,6 +811,15 @@ export async function performSummary(
options: {
systemPrompt: "You are a content summarization expert. Analyze the provided content and create a concise, informative summary that captures the key points, main ideas, and essential information. Focus on clarity and brevity while maintaining accuracy.",
prompt: "Summarize the main content and key points from this page.",
+ schema: {
+ type: "object",
+ properties: {
+ summary: {
+ type: "string",
+ },
+ },
+ required: ["summary"],
+ }
},
markdown: document.markdown,
previousWarning: document.warning,
@@ -826,7 +835,7 @@ export async function performSummary(
};
const {
- extract: summaryText,
+ extract,
warning,
totalUsage,
model,
@@ -843,7 +852,7 @@ export async function performSummary(
totalTokens: totalUsage.totalTokens,
});
- document.summary = typeof summaryText === 'string' ? summaryText : String(summaryText || '');
+ document.summary = extract.summary;
}
return document;