mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-14 04:26:06 +08:00
fix(llmExtract): arbitrary objects caused error to be thrown
This commit is contained in:
parent
570809aa59
commit
f5e5bdb710
@ -74,9 +74,9 @@ function normalizeSchema(x: any): any {
|
|||||||
return {
|
return {
|
||||||
...x,
|
...x,
|
||||||
properties: Object.fromEntries(
|
properties: Object.fromEntries(
|
||||||
Object.entries(x.properties).map(([k, v]) => [k, normalizeSchema(v)]),
|
Object.entries(x.properties || {}).map(([k, v]) => [k, normalizeSchema(v)]),
|
||||||
),
|
),
|
||||||
required: Object.keys(x.properties),
|
required: Object.keys(x.properties || {}),
|
||||||
additionalProperties: false,
|
additionalProperties: false,
|
||||||
};
|
};
|
||||||
} else if (x && x.type === "array") {
|
} else if (x && x.type === "array") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user