diff --git a/packages/tui/src/component/prompt/index.tsx b/packages/tui/src/component/prompt/index.tsx index 00efcbed2887..9a692881cc97 100644 --- a/packages/tui/src/component/prompt/index.tsx +++ b/packages/tui/src/component/prompt/index.tsx @@ -272,7 +272,8 @@ export function Prompt(props: PromptProps) { if (tokens <= 0) return const model = sync.data.provider.find((item) => item.id === last.providerID)?.models[last.modelID] - const pct = model?.limit.context ? `${Math.round((tokens / model.limit.context) * 100)}%` : undefined + const limit = model?.limit.input ?? model?.limit.context + const pct = limit ? `${Math.round((tokens / limit) * 100)}%` : undefined const cost = session?.cost ?? 0 return { context: pct ? `${Locale.number(tokens)} (${pct})` : Locale.number(tokens),