nanobot: 2026-09-14 21:16:00 — usage: models only in Models section, not inline
This commit is contained in:
@@ -28,12 +28,6 @@ def load_api_key() -> str:
|
||||
sys.exit("OLLAMA_API_KEY not found (neither env nor workspace/.env)")
|
||||
|
||||
|
||||
def fmt_models(models: list[dict]) -> str:
|
||||
if not models:
|
||||
return ""
|
||||
return ", ".join(f'{m["name"]} ({m["request_count"]})' for m in models)
|
||||
|
||||
|
||||
def until_next_full_hour(now: datetime) -> timedelta:
|
||||
nxt = (now.replace(minute=0, second=0, microsecond=0)
|
||||
+ timedelta(hours=1))
|
||||
@@ -77,17 +71,13 @@ def main() -> None:
|
||||
now = datetime.now(timezone.utc)
|
||||
|
||||
print("Ollama Cloud usage")
|
||||
s_models = fmt_models(session.get("models", []))
|
||||
print(
|
||||
f'Session: {session.get("usage", 0) * 100:.1f} %, '
|
||||
f'resets in {fmt_delta_short(until_next_full_hour(now))}'
|
||||
+ (f" — {s_models}" if s_models else "")
|
||||
)
|
||||
w_models = fmt_models(weekly.get("models", []))
|
||||
print(
|
||||
f'Weekly: {weekly.get("usage", 0) * 100:.1f} %, '
|
||||
f'resets in {fmt_delta_short(until_next_monday(now))}'
|
||||
+ (f" — {w_models}" if w_models else "")
|
||||
)
|
||||
|
||||
models = weekly.get("models", [])
|
||||
|
||||
Reference in New Issue
Block a user