mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-14 22:36:14 +08:00
fix(scrape): ensure extractionSchema is an object if llm-extraction is specified
This commit is contained in:
parent
4bd2ff26d3
commit
0e8fd6ce70
@ -105,6 +105,10 @@ export async function scrapeController(req: Request, res: Response) {
|
|||||||
let timeout = req.body.timeout ?? defaultTimeout;
|
let timeout = req.body.timeout ?? defaultTimeout;
|
||||||
|
|
||||||
if (extractorOptions.mode.includes("llm-extraction")) {
|
if (extractorOptions.mode.includes("llm-extraction")) {
|
||||||
|
if (typeof extractorOptions.extractionSchema !== "object" || extractorOptions.extractionSchema === null) {
|
||||||
|
return res.status(400).json({ error: "extractorOptions.extractionSchema must be an object if llm-extraction mode is specified" });
|
||||||
|
}
|
||||||
|
|
||||||
pageOptions.onlyMainContent = true;
|
pageOptions.onlyMainContent = true;
|
||||||
timeout = req.body.timeout ?? 90000;
|
timeout = req.body.timeout ?? 90000;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user