update list models

This commit is contained in:
Johannes Reichhardt 2026-03-31 20:24:11 -05:00
parent e6f7a47f4f
commit 60163fdf67
1 changed files with 15 additions and 0 deletions

15
list_models.py Normal file
View File

@ -0,0 +1,15 @@
import os
import google.generativeai as genai
from dotenv import load_dotenv
load_dotenv()
api_key = os.environ.get("AI_API_KEY") or os.environ.get("GOOGLE_API_KEY")
genai.configure(api_key=api_key)
try:
print("Listing available models...")
for m in genai.list_models():
if 'generateContent' in m.supported_generation_methods:
print(f"Model: {m.name}")
except Exception as e:
print(f"Error: {e}")