fix(scrapeURL/llmExtract): array schema fix

This commit is contained in:
Gergő Móricz 2024-11-07 22:46:59 +01:00
parent 552d55c8fc
commit 0588f340c3

View File

@ -25,6 +25,11 @@ function normalizeSchema(x: any): any {
properties: Object.fromEntries(Object.entries(x.properties).map(([k, v]) => [k, normalizeSchema(v)])),
additionalProperties: false,
}
} else if (x && x.type === "array") {
return {
...x,
items: normalizeSchema(x.items),
}
} else {
return x;
}