update list models
This commit is contained in:
parent
e6f7a47f4f
commit
60163fdf67
|
|
@ -0,0 +1,15 @@
|
|||
import os
|
||||
import google.generativeai as genai
|
||||
from dotenv import load_dotenv
|
||||
|
||||
load_dotenv()
|
||||
api_key = os.environ.get("AI_API_KEY") or os.environ.get("GOOGLE_API_KEY")
|
||||
genai.configure(api_key=api_key)
|
||||
|
||||
try:
|
||||
print("Listing available models...")
|
||||
for m in genai.list_models():
|
||||
if 'generateContent' in m.supported_generation_methods:
|
||||
print(f"Model: {m.name}")
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
Loading…
Reference in New Issue