const { VertexAI } = require('@google-cloud/vertexai'); async function testGemini3Global() { console.log('๐Ÿงช Testing Gemini 3 Pro Preview in GLOBAL location...\n'); const vertexAI = new VertexAI({ project: 'gen-lang-client-0980079410', location: 'global', // โ† KEY: Use 'global' not regional! }); console.log('Model: gemini-3-pro-preview'); console.log('Location: global'); console.log('Project: gen-lang-client-0980079410\n'); try { const model = vertexAI.getGenerativeModel({ model: 'gemini-3-pro-preview', systemInstruction: 'You are a helpful AI assistant.', generationConfig: { temperature: 1.0, responseMimeType: 'application/json', }, }); console.log('โณ Sending test request...\n'); const response = await model.generateContent({ contents: [{ role: 'user', parts: [{ text: 'Return JSON with this exact structure: {"status": "success", "model": "gemini-3-pro-preview", "message": "Gemini 3 is working!", "features": ["thinking_mode", "1M_context", "multimodal"]}' }], }], }); const text = response.response?.candidates?.[0]?.content?.parts?.[0]?.text || ''; console.log('โœ… RAW RESPONSE:\n', text, '\n'); const parsed = JSON.parse(text); if (parsed.status === 'success') { console.log('๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰ SUCCESS! GEMINI 3 PRO PREVIEW IS WORKING! ๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰\n'); console.log('โœ… Model:', parsed.model); console.log('โœ… Message:', parsed.message); console.log('โœ… Features:', parsed.features?.join(', ')); console.log('\n๐Ÿš€ You have full access to Gemini 3 Pro Preview!'); console.log('๐Ÿ“Š 1M token context | Thinking mode | Multimodal'); return true; } } catch (error) { console.error('โŒ Error:', error.message); if (error.message.includes('404')) { console.log('\n๐Ÿ’ก Model still not accessible. You may need to:'); console.log(' 1. Enable the model in the console'); console.log(' 2. Accept usage terms'); console.log(' 3. Wait for API access approval'); } return false; } } testGemini3Global();