abuse: строгий free_count (prompt и completion = 0) — 90 панелей вместо 131; sync_panel_items держит тексты панелей в актуальном виде; push_top отправляет топ находок в бота
Some checks failed
ci / test (3.10) (push) Has been cancelled
ci / test (3.11) (push) Has been cancelled
ci / test (3.12) (push) Has been cancelled

This commit is contained in:
Vlad Gothbreach
2026-10-27 14:59:01 +03:00
parent d16994d45c
commit e26bd41a84
7 changed files with 124 additions and 6 deletions

View File

@@ -64,9 +64,16 @@ def probe(entry: dict, timeout: int) -> dict:
if not isinstance(m, dict):
continue
ratio = m.get("model_ratio")
cratio = m.get("completion_ratio")
quota = m.get("quota_type")
try:
freeish = (ratio is not None and float(ratio) == 0.0) or (quota == 0)
# Строго как адаптер newapi_pricing: модель бесплатна только если
# нулевые И prompt, И completion. Мягкое «ratio==0 или quota==0»
# завышало счётчик в разы (760 моделей на панели с 1 бесплатной).
if ratio is None and cratio is None:
freeish = (quota == 0)
else:
freeish = float(ratio or 0) == 0.0 and float(cratio or 0) == 0.0
except Exception:
freeish = False
if freeish: