import { gemini } from './src/ai/gemini.js'; import { db } from './src/db/database.js'; async function test() { try { const apiKey = db.getSetting('gemini_api_key'); const prompt = 'Test bild'; const url = `https://generativelanguage.googleapis.com/v1beta/models/gemini-3.1-flash-image:predict?key=${apiKey}`; const body = { instances: [{ prompt: prompt }], parameters: { sampleCount: 1 } }; const res = await fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body) }); const text = await res.text(); console.log('Result length:', text.length); console.log('Result preview:', text.substring(0, 200)); } catch(e) { console.error('Error:', e); } } test();