ValyroUI English version

Context Budget Meter

Окно контекста по частям: системный промпт, документы, история, переполнение и что сократить. Pro · ИИ: чат и агенты › Токены и контекст

Установка

npx valyro-cli@latest login
npx valyro-cli@latest add context-budget-meter
npm install valyro-ui-pro

import 'valyro-ui-pro/styles.css';
import { ContextBudgetMeter } from 'valyro-ui-pro';

Пропсы

PropTypeDefault
segments *ContextSegment[]Parts of the prompt in the order they are sent: system, memory, documents, history, tool output.
limit *numberThe model's context window in tokens.
reservenumber0Tokens kept free for the answer. Default 0.
warnAtnumber0.85Share of the window that turns the meter amber. Default 0.85.
onTrim(segmentId: string, tokens: number) => voidAdds Trim buttons to the suggested cuts; called with the segment and how many tokens to cut.
variant'full' | 'compact''full'full (default) adds the legend, breakdown and trim plan; compact is the bar and one line.
loadingbooleanfalseTokens are being counted: skeleton.
errorReactNodeCounting failed: shown instead of the meter.
titleReactNodeHeading. Default: labels.title.
headingLevel2 | 3 | 4 | 53Level of the heading (default 3).
localestringBCP 47 locale for numbers; defaults to the ThemeProvider's.
labelsPartial<Omit<ContextBudgetMeterLabels, 'statuses' | 'kinds'>> & { statuses?: Partial<Record<BudgetStatus, string>>; kinds?: Partial<Record<ContextSegmentKind, string>>; }Overrides for the built-in English text; keys left out keep their defaults.

Похожие компоненты

Назад: Token Usage · Далее: Prompt Editor · Весь раздел «ИИ: чат и агенты»