Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥
TypeScript aiai-agentsai-crawlerai-scrapingai-searchcrawlerdata-extractionhtml-to-markdownllmmarkdownscraperscrapingweb-crawlerweb-dataweb-data-extractionweb-scraperweb-scrapingweb-searchwebscraping
fix(llmExtract): arbitrary objects caused error to be thrown
Gergő Móriczf5e5bdb710ef
diff --git a/apps/api/src/scraper/scrapeURL/transformers/llmExtract.ts b/apps/api/src/scraper/scrapeURL/transformers/llmExtract.tsindex e3c76362e..74b3ff9df 100644--- a/apps/api/src/scraper/scrapeURL/transformers/llmExtract.ts+++ b/apps/api/src/scraper/scrapeURL/transformers/llmExtract.ts@@ -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") {