0
This commit is contained in:
Nicolas 2024-04-23 17:46:32 -07:00
parent fdb2789eaa
commit 479fa2f7f8
2 changed files with 3 additions and 2 deletions

View File

@ -23,7 +23,7 @@ export async function search({
timeout?: number; timeout?: number;
}) { }) {
try { try {
if (process.env.SERPER_API_KEY) { if (process.env.SERPER_API_KEY && !tbs) {
return await serper_search(query, num_results); return await serper_search(query, num_results);
} }
return await google_search( return await google_search(

View File

@ -6,7 +6,8 @@ dotenv.config();
export async function serper_search(q, num_results) : Promise<string[]> { export async function serper_search(q, num_results) : Promise<string[]> {
let data = JSON.stringify({ let data = JSON.stringify({
q: q, q: q,
"num": num_results "num": num_results,
}); });
let config = { let config = {