Format token count for display (e.g. 878K, 1.8M).
(n: int)
| 132 | |
| 133 | |
| 134 | def fmt_tokens(n: int) -> str: |
| 135 | """Format token count for display (e.g. 878K, 1.8M).""" |
| 136 | if n >= 1_000_000: |
| 137 | return f"{n / 1_000_000:.1f}M" |
| 138 | if n >= 1_000: |
| 139 | return f"{n / 1_000:.0f}K" |
| 140 | return str(n) |
| 141 | |
| 142 | |
| 143 | def git_metadata() -> dict: |
no outgoing calls
no test coverage detected