Spaces:
Sleeping
Sleeping
Download model-search.py from odeyaaa/social-assistent: direct link, hf CLI and curl.
- Browser
- Download file 702 Bytes
-
https://huggingface.co/spaces/odeyaaa/social-assistent/resolve/main/model-search.py
- Command line
-
hf download hf://spaces/odeyaaa/social-assistent/model-search.py
-
curl -L -o model-search.py https://huggingface.co/spaces/odeyaaa/social-assistent/resolve/main/model-search.py
702 Bytes
| 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) |