Spaces:
Running
Running
File size: 474 Bytes
afd56bc | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | import os
try:
import google.generativeai as genai
api_key = os.environ.get("GOOGLE_API_KEY")
if api_key:
genai.configure(api_key=api_key)
models = genai.list_models()
print("Available models:")
for m in models:
if "generateContent" in m.supported_generation_methods:
print(m.name)
else:
print("No GOOGLE_API_KEY found")
except ImportError:
print("google.generativeai not installed")
|