Trust-first-AI-Copilot / backend /list_models.py
Abhisingh-18's picture
Mirror of github.com/Abhisingh18/Trust-first-AI-Copilot
f35583f verified
Raw
History Blame Contribute Delete
355 Bytes
import google.generativeai as genai
from app.core.config import settings
genai.configure(api_key=settings.GEMINI_API_KEY)
print("Listing models...")
try:
for m in genai.list_models():
if 'generateContent' in m.supported_generation_methods:
print(m.name)
except Exception as e:
print(f"Error listing models: {e}")