Spaces:
Sleeping
Sleeping
| import google.generativeai as genai | |
| import os | |
| from dotenv import load_dotenv | |
| # 1. Load your API key | |
| load_dotenv() | |
| api_key = os.getenv("GEMINI_API_KEY") | |
| if not api_key: | |
| print("Error: API key not found. Make sure it is in your .env file.") | |
| else: | |
| genai.configure(api_key=api_key) | |
| print("--- Available Gemini Models ---") | |
| # 2. List all models and filter for those that generate content (text/chat) | |
| for m in genai.list_models(): | |
| if 'generateContent' in m.supported_generation_methods: | |
| print(f"Name: {m.name}") | |
| print(f" - Display Name: {m.display_name}") | |
| print(f" - Input Limit: {m.input_token_limit} tokens") | |
| print("-" * 30) |