fix(llmExtract): arbitrary objects caused error to be thrown
This commit is contained in:
@@ -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") {
|
||||||
|
|||||||
Reference in New Issue
Block a user