refactor: use GEMINI_API_KEY for Google Search as well

This commit is contained in:
2025-12-18 12:59:35 +01:00
parent ddf352dab6
commit 61a7966579

View File

@@ -10,13 +10,14 @@ export async function discoverWhiskybaseId(bottle: {
abv?: number;
age?: number;
}) {
const apiKey = process.env.GOOGLE_API_KEY;
// Both Gemini and Custom Search often use the same API key if created via AI Studio
const apiKey = process.env.GEMINI_API_KEY || process.env.GOOGLE_API_KEY;
const cx = '37e905eb03fd14e0f'; // Provided by user
if (!apiKey) {
return {
success: false,
error: 'GOOGLE_API_KEY ist nicht konfiguriert.'
error: 'GEMINI_API_KEY oder GOOGLE_API_KEY ist nicht konfiguriert.'
};
}