From 0588f340c31df56a368f83d2475eb1bf596458b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20M=C3=B3ricz?= Date: Thu, 7 Nov 2024 22:46:59 +0100 Subject: [PATCH] fix(scrapeURL/llmExtract): array schema fix --- apps/api/src/scraper/scrapeURL/transformers/llmExtract.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/api/src/scraper/scrapeURL/transformers/llmExtract.ts b/apps/api/src/scraper/scrapeURL/transformers/llmExtract.ts index e7ffc4b2..ae6ce4b6 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; }