Credible / check_models.py
tomalex04's picture
Initial commit
700863c
raw
history blame
478 Bytes
"""
Check available models in Google Generative AI.
"""
import os
import google.generativeai as genai
from dotenv import load_dotenv
# Load environment variables
load_dotenv()
# Set up the Gemini API with the API key
GEMINI_API_KEY = os.getenv('GEMINI_API_KEY')
if not GEMINI_API_KEY:
raise ValueError("GEMINI_API_KEY environment variable not set")
genai.configure(api_key=GEMINI_API_KEY)
# List available models
for model in genai.list_models():
print(model.name)