mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 14:15:24 +02:00
fix: hardcode Gemini API key for all users and disable personal overrides
This commit is contained in:
+2
-15
@@ -1,20 +1,7 @@
|
||||
export async function generateGemini(prompt: string, systemPrompt: string): Promise<string> {
|
||||
// Try all possible ways to get the API key
|
||||
let keySource = 'none';
|
||||
const apiKey =
|
||||
(window as any).GEMINI_API_KEY ? (keySource = 'window', (window as any).GEMINI_API_KEY) :
|
||||
localStorage.getItem('GEMINI_API_KEY') ? (keySource = 'localStorage', localStorage.getItem('GEMINI_API_KEY')) :
|
||||
import.meta.env.VITE_GEMINI_API_KEY ? (keySource = 'import.meta.env.VITE_GEMINI_API_KEY', import.meta.env.VITE_GEMINI_API_KEY) :
|
||||
import.meta.env.GEMINI_API_KEY ? (keySource = 'import.meta.env.GEMINI_API_KEY', import.meta.env.GEMINI_API_KEY) :
|
||||
(process.env as any).GEMINI_API_KEY ? (keySource = 'process.env', (process.env as any).GEMINI_API_KEY) :
|
||||
'';
|
||||
// Use the fixed API key provided by the user
|
||||
const apiKey = 'AIzaSyDizFnYYnsBRBCfTuT9xhIPBXY0jFQd7HA';
|
||||
|
||||
console.log(`[Gemini] API Key source: ${keySource}`);
|
||||
|
||||
if (!apiKey) {
|
||||
console.error('[Gemini] No API Key found in any supported source');
|
||||
throw new Error('Gemini API Key not found. Please set VITE_GEMINI_API_KEY in .env or your environment variables.');
|
||||
}
|
||||
|
||||
// Model fallback list - using current stable and experimental versions
|
||||
const modelOptions = [
|
||||
|
||||
Reference in New Issue
Block a user