-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel_list.py
More file actions
27 lines (21 loc) · 749 Bytes
/
model_list.py
File metadata and controls
27 lines (21 loc) · 749 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import os
from dotenv import load_dotenv
from google import genai
def main():
load_dotenv()
api_key = os.environ.get("GEMINI_API_KEY")
if not api_key:
print("HATA: .env dosyasında GEMINI_API_KEY bulunamadı.")
return
client = genai.Client(api_key=api_key)
print("\n🔎 KULLANILABİLİR MODELLER TARANIYOR...\n")
try:
# SDK üzerinden model listesini çekiyoruz
for model in client.models.list():
# Model ismini (örn: models/gemini-1.5-flash) temizleyelim
model_id = model.name.split("/")[-1]
print(f"✅ Model ID: {model_id}")
except Exception as e:
print(f"LİSTELEME HATASI: {e}")
if __name__ == "__main__":
main()