Skip to content

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

Update search.ts

Nicolas5229a4902b48
diff --git a/apps/api/src/controllers/search.ts b/apps/api/src/controllers/search.ts
index 41270cb50..010af4253 100644
--- a/apps/api/src/controllers/search.ts
+++ b/apps/api/src/controllers/search.ts
@@ -54,10 +54,12 @@ export async function searchHelper(
// filter out social media links
+ console.log("Search results", searchOptions.limit);
+
const a = new WebScraperDataProvider();
await a.setOptions({
mode: "single_urls",
- urls: res.map((r) => r.url),
+ urls: res.map((r) => r.url).slice(0, searchOptions.limit ?? 7),
crawlerOptions: {
...crawlerOptions,
},
@@ -69,7 +71,7 @@ export async function searchHelper(
},
});
- const docs = await a.getDocuments(true);
+ const docs = await a.getDocuments(false);
if (docs.length === 0) {
return { success: true, error: "No search results found", returnCode: 200 };
}