Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

fix(scrapeURL/llmExtract): array schema fix

Gergő Móricz0588f340c31d
diff --git a/apps/api/src/scraper/scrapeURL/transformers/llmExtract.ts b/apps/api/src/scraper/scrapeURL/transformers/llmExtract.ts
index e7ffc4b22..ae6ce4b6a 100644
--- a/apps/api/src/scraper/scrapeURL/transformers/llmExtract.ts
+++ b/apps/api/src/scraper/scrapeURL/transformers/llmExtract.ts
@@ -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;
}