Download scratch/inspect_google_client.py from akra35567/Akiragpu: direct link, hf CLI and curl.
- Browser
- Download file 774 Bytes
-
https://huggingface.co/spaces/akra35567/Akiragpu/resolve/main/scratch/inspect_google_client.py
- Command line
-
hf download hf://spaces/akra35567/Akiragpu/scratch/inspect_google_client.py
-
curl -L -o inspect_google_client.py https://huggingface.co/spaces/akra35567/Akiragpu/resolve/main/scratch/inspect_google_client.py
774 Bytes
| import os | |
| from google import genai | |
| from loguru import logger | |
| def inspect_client(): | |
| 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("Inspecting client.models...") | |
| methods = [m for m in dir(client.models) if not m.startswith('_')] | |
| print(f"Methods available in client.models: {methods}") | |
| print("\nListing models and their supported methods:") | |
| try: | |
| for model in client.models.list(): | |
| print(f"Model: {model.name}, Methods: {model.supported_generation_methods}") | |
| except Exception as e: | |
| print(f"Error listing models: {e}") | |
| if __name__ == "__main__": | |
| inspect_client() | |