Gini-Eddie's picture
Deployment of AI Recruitment Intelligence Backend
5f277bb
Raw History Blame Contribute Delete
644 Bytes
import os
from google import genai
from dotenv import load_dotenv
# Load the API key from your .env file
load_dotenv()
print("Attempting to connect to Gemini API...")
try:
client = genai.Client(api_key=os.getenv("GEMINI_API_KEY"))
# A simple, tiny request
response = client.models.generate_content(
model='gemini-2.5-flash',
contents='Reply with the exact words: "Connection Successful!"'
)
print("\n✅ SUCCESS! The API is reachable.")
print(f"Gemini says: {response.text}")
except Exception as e:
print("\n❌ FAILED. The network block is still active.")
print(f"Error Details: {str(e)}")