diff --git a/apps/api/src/search/index.ts b/apps/api/src/search/index.ts index 0f3a596..ae62451 100644 --- a/apps/api/src/search/index.ts +++ b/apps/api/src/search/index.ts @@ -23,7 +23,7 @@ export async function search({ timeout?: number; }) { try { - if (process.env.SERPER_API_KEY) { + if (process.env.SERPER_API_KEY && !tbs) { return await serper_search(query, num_results); } return await google_search( diff --git a/apps/api/src/search/serper.ts b/apps/api/src/search/serper.ts index f92f2fc..2b4ba02 100644 --- a/apps/api/src/search/serper.ts +++ b/apps/api/src/search/serper.ts @@ -6,7 +6,8 @@ dotenv.config(); export async function serper_search(q, num_results) : Promise { let data = JSON.stringify({ q: q, - "num": num_results + "num": num_results, + }); let config = {