mirror of
https://github.com/mendableai/firecrawl.git
synced 2024-11-16 11:42:24 +08:00
Nick:
This commit is contained in:
parent
552328d168
commit
b8920d6f4a
|
@ -28,7 +28,7 @@ export async function scrapeController(
|
|||
const origin = req.body.origin;
|
||||
const timeout = req.body.timeout;
|
||||
const pageOptions = legacyScrapeOptions(req.body);
|
||||
const extractorOptions = legacyExtractorOptions(req.body.extract);
|
||||
const extractorOptions = req.body.extract ? legacyExtractorOptions(req.body.extract) : undefined;
|
||||
const jobId = uuidv4();
|
||||
|
||||
const startTime = new Date().getTime();
|
||||
|
|
|
@ -312,12 +312,12 @@ export function legacyScrapeOptions(x: ScrapeOptions): PageOptions {
|
|||
};
|
||||
}
|
||||
|
||||
export function legacyExtractorOptions(x?: ExtractOptions): ExtractorOptions {
|
||||
export function legacyExtractorOptions(x: ExtractOptions): ExtractorOptions {
|
||||
return {
|
||||
mode: x?.mode ? "llm-extraction" : "markdown",
|
||||
extractionPrompt: x?.prompt ?? "Based on the information on the page, extract the information from the schema.",
|
||||
extractionSchema: x?.schema,
|
||||
userPrompt: x?.prompt ?? "",
|
||||
mode: x.mode ? "llm-extraction" : "markdown",
|
||||
extractionPrompt: x.prompt ?? "Based on the information on the page, extract the information from the schema.",
|
||||
extractionSchema: x.schema,
|
||||
userPrompt: x.prompt ?? "",
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user