fix: expose serper response code

This commit is contained in:
yanlong.wang
2025-03-11 12:07:47 +08:00
parent 8df4df5b0a
commit 662fa9819e

View File

@@ -15,6 +15,10 @@ export async function serperSearch(query: string): Promise<{ response: SerperSea
timeout: 10000
});
if (response.status !== 200) {
throw new Error(`Serper search failed: ${response.status} ${response.statusText}`)
}
// Maintain the same return structure as the original code
return { response: response.data };
}