fix(llmExtract): arbitrary objects caused error to be thrown

This commit is contained in:
Gergő Móricz 2025-04-05 15:48:47 +02:00
parent 570809aa59
commit f5e5bdb710

View File

@ -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") {