Repository navigation
Chrome UsageByModel
A list of the models used in a chat, with each model's share of the tokens and a total. It also covers ModelUsage, one model and its token count.
import 'package:agent_kit/agent_kit.dart';
By model, 252 px: two models and the folded row. The gallery data has a third model under 1% of the total, which folds into "Other" and shows as <1%. The footer shows the input and output token total.
| Parameter | Type | Notes |
|---|---|---|
models |
List<ModelUsage> |
Required. Each model and its tokens. |
usage |
Usage? |
Input and output tokens for the footer. The footer shows only when both are non-null. |
title |
String |
Default 'By model'. The heading. |
| Parameter | Type | Notes |
|---|---|---|
model |
String |
The model's name. |
tokens |
int |
The model's token count. |
BbTheme roles read in usage_view.dart:
-
ink,muted,faint -
seam(the bar track),surface -
radii.field,typeScale.ui,typeScale.uiSmall
Does not read the size class. Models under 1% of the total fold into Other, shown as <1%. A total of 0 shows No usage yet. The footer reads <formatTokens(input + output)> tokens.
- The view is a container with the semantics label of its
title(usage_view.dart:71).
- Gallery scene: the Components scene (
apps/gallery/lib/src/components_scene.dart). Specimens:ChromeSpecimensinapps/gallery/lib/components/chrome.dart(UsageByModel at 252 px, with models flash 960000, sol 280000 and nano 4000). - Golden shot:
apps/gallery/test/component_shots_test.dartwritesusage_by_model(UsageByModel 0) toapps/gallery/test/goldens/shots/.scenes_golden_test.dartcovers the sheet ascomponents_1000_light.pngandcomponents_1000_dark.png. -
packages/agent_kit/test/chrome/chrome_test.dart: "shares by model with the small ones folded" and "says so when there is no usage". -
packages/agent_kit/test/chrome/chrome_golden_test.dart: the crew and header goldens include the strip; the usage view has no golden of its own. -
packages/agent_kit/test/compositions/agent_workbench_test.dartmentions the view.
Generated from docs/components/chrome/UsageByModel.md. Edit the file there; changes made on the wiki are overwritten.
Guides
- Package layout and pinning
- agent_kit_core
- Backend mapping
- agent_kit and the gallery
- Icon and README assets
Component sheets
theme
status
transcript
- ActivityGroupView
- AssistantProse
- ChildQuestionRow
- CodeBlock
- DiffView
- ExecOutput
- FileEditRow
- PlanChecklist
- ReturnLine
- SystemLineView
- TranscriptList
- UserBubble
composer
chrome
context
history
outline
workspace
compositions
providers