Download scratch/list_google_models.py from akra35567/Akiragpu: direct link, hf CLI and curl.
- Browser
- Download file 485 Bytes
-
https://huggingface.co/spaces/akra35567/Akiragpu/resolve/main/scratch/list_google_models.py
- Command line
-
hf download hf://spaces/akra35567/Akiragpu/scratch/list_google_models.py
-
curl -L -o list_google_models.py https://huggingface.co/spaces/akra35567/Akiragpu/resolve/main/scratch/list_google_models.py
485 Bytes
| import os | |
| from google import genai | |
| from loguru import logger | |
| def list_models(): | |
| api_key = os.getenv("GOOGLE_API_KEY") or os.getenv("GEMINI_API_KEY") | |
| if not api_key: | |
| print("API KEY não encontrada") | |
| return | |
| client = genai.Client(api_key=api_key) | |
| print("Listing models...") | |
| for model in client.models.list(): | |
| print(f"Model: {model.name}, Supported Methods: {model.supported_generation_methods}") | |
| if __name__ == "__main__": | |
| list_models() | |