Skip to content

Usage

🛈 DocStrings

Context window use and cost.

Source code in src/acptui/protocol/state.py
@dataclass(frozen=True)
class Usage:
    """Context window use and cost."""

    used: int
    size: int
    cost: Cost | None = None

    @property
    def fraction(self) -> float:
        """Used part of the context window (0..1)."""
        return self.used / self.size if self.size else 0.0

fraction property

fraction: float

Used part of the context window (0..1).

:fa-brands-github: Show source on GitHub