diff --git a/skills/usage/SKILL.md b/skills/usage/SKILL.md index 50d8fd4..ed988a3 100644 --- a/skills/usage/SKILL.md +++ b/skills/usage/SKILL.md @@ -22,18 +22,20 @@ never scrape the website. ## Output -Format (script prints it, present it to the user as-is): +Format (script prints it, present it to the user as-is — same lines, same +order; translate the labels to Czech, keep the numbers exact; no extra +model info on the Session/Weekly lines): ``` Ollama Cloud usage -Session: %, resets in X hours — (), … -Weekly: %, resets in Y days — (), … +Session: %, resets in X hours +Weekly: %, resets in Y days Models (request count, weekly window): : ``` -Present the script output to the user in Czech (translate the labels, keep -the numbers exact). +The per-model breakdown lives only in the "Models" section — never inline +on the Session/Weekly lines. ## Reset times — derived, not from the API diff --git a/skills/usage/scripts/ollama_usage.py b/skills/usage/scripts/ollama_usage.py index d186238..176eca4 100644 --- a/skills/usage/scripts/ollama_usage.py +++ b/skills/usage/scripts/ollama_usage.py @@ -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", [])