phi-drift / scratch /gemini_test.py
crexs's picture
Upload folder using huggingface_hub
a5acf49 verified
Raw
History Blame Contribute Delete
545 Bytes
import os
import sys
from google import genai
api_key = "AIzaSyBYp_RCEkPAQCAqgktvPGKola55tunKo5I"
print(f"[TEST] Using API Key: {api_key[:10]}...")
try:
print("[TEST] Creating genai Client...")
client = genai.Client(api_key=api_key)
print("[TEST] Client created. Generating content...")
response = client.models.generate_content(
model="gemini-2.5-flash",
contents="Hello, say test"
)
print(f"[TEST] Response received: {response.text}")
except Exception as e:
print(f"[TEST] Exception raised: {e}")