trading_agent.terminal.widgets.context_card
¶
The side panel's Context card: how full the model's context window is, and with what.
A bar of coloured blocks shows each category's share, in the web page's swatch colours, followed by one row per category. Categories the model loads only when needed ("deferred") are listed apart.
Typical usage example:
card = ContextCard() card.show(context_document)
ContextCard
¶
Bases: SideCard
The Context card.
Creates the card.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
collapsed
|
bool
|
Whether it starts folded. |
False
|
Source code in src/trading_agent/terminal/widgets/context_card.py
show
¶
Shows the context window's use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
usage
|
dict[str, Any] | None
|
The usage snapshot, or None before the desk's first turn. |
required |
error
|
str | None
|
Why it could not be read, or None. |
required |