Format token count with color based on size
(n: int)
| 108 | |
| 109 | |
| 110 | def format_tokens(n: int) -> str: |
| 111 | """Format token count with color based on size""" |
| 112 | if n == 0: |
| 113 | return f"{Colors.DIM}0{Colors.RESET}" |
| 114 | elif n < 1000: |
| 115 | return f"{Colors.GREEN}{n}{Colors.RESET}" |
| 116 | elif n < 10000: |
| 117 | return f"{Colors.YELLOW}{n:,}{Colors.RESET}" |
| 118 | else: |
| 119 | return f"{Colors.RED}{n:,}{Colors.RESET}" |
| 120 | |
| 121 | |
| 122 | def format_tool(name: str, status: str = "active") -> str: |