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 {
...x,
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,
};
} else if (x && x.type === "array") {