refactor: use GEMINI_API_KEY for Google Search as well
This commit is contained in:
@@ -10,13 +10,14 @@ export async function discoverWhiskybaseId(bottle: {
|
|||||||
abv?: number;
|
abv?: number;
|
||||||
age?: 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
|
const cx = '37e905eb03fd14e0f'; // Provided by user
|
||||||
|
|
||||||
if (!apiKey) {
|
if (!apiKey) {
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false,
|
||||||
error: 'GOOGLE_API_KEY ist nicht konfiguriert.'
|
error: 'GEMINI_API_KEY oder GOOGLE_API_KEY ist nicht konfiguriert.'
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user