add tests
This commit is contained in:
commit
e01a51e2ae
17 changed files with 823 additions and 0 deletions
23
models_list.py
Normal file
23
models_list.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import os
|
||||
from dotenv import load_dotenv
|
||||
from openai import OpenAI
|
||||
|
||||
# Загружаем настройки из .env
|
||||
load_dotenv()
|
||||
|
||||
client = OpenAI(
|
||||
api_key=os.getenv("LAOZHANG_API_KEY"),
|
||||
base_url=os.getenv("LAOZHANG_BASE_URL")
|
||||
)
|
||||
|
||||
try:
|
||||
print("--- Список доступных моделей ---")
|
||||
# Запрашиваем список у сервера
|
||||
models = client.models.list()
|
||||
|
||||
# Выводим только ID моделей (названия)
|
||||
for model in models:
|
||||
print(f"ID: {model.id}")
|
||||
|
||||
except Exception as e:
|
||||
print(f"Ошибка при получении списка: {e}")
|
||||
Loading…
Add table
Add a link
Reference in a new issue