TokenMeter
A one-line context-window meter: used/limit token counts, a utilization
bar, and a percentage (Context: 78k/200k [####......] 39%). From
warningThreshold of the limit (80% by default) it adds NEAR LIMIT, and
from errorThreshold (95% by default) OVER LIMIT — words, not color
alone, so the state reads in monochrome.
Import: package:fleury/fleury.dart, or package:fleury/fleury_core.dart in browser code.
TokenMeter( usage: const TokenUsage(contextUsed: 128000, contextLimit: 200000), label: 'Context', width: 20,)Constructors
Section titled “Constructors”TokenMeter()
Section titled “TokenMeter()”| Parameter | Type | Default | Description |
|---|---|---|---|
usage: | TokenUsage | required | Token and context-window metrics to display. |
label: | String | 'Context' | Visible and semantic label placed before the usage value. |
width: | int | 10 | Number of cells used by the utilization bar; zero hides the bar. |
warningThreshold: | double | 0.8 | Context-usage ratio at which the near-limit state begins. |
errorThreshold: | double | 0.95 | Context-usage ratio at which the over-limit state begins. |
Source
Section titled “Source”TokenMeter is defined in packages/fleury/lib/src/catalog/model_status_bar.dart.
Category: Agent surfaces · All widgets