customeragent-api / server /scripts /list_gemini_models.py
anasraza526's picture
Clean deploy to Hugging Face
ac90985
import os
import google.generativeai as genai
from dotenv import load_dotenv
load_dotenv()
api_key = os.getenv("GEMINI_API_KEY")
if not api_key:
print("GEMINI_API_KEY not found in .env")
else:
genai.configure(api_key=api_key)
print("--- Available Models ---")
try:
for m in genai.list_models():
if 'generateContent' in m.supported_generation_methods:
print(f"Model: {m.name} | Display: {m.display_name}")
except Exception as e:
print(f"Error listing models: {e}")