mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-28 19:52:02 +00:00
chore: sync gemini-cli v0.1.19
This commit is contained in:
commit
7dbc240847
244 changed files with 19407 additions and 5030 deletions
25
packages/cli/src/ui/components/ContextUsageDisplay.tsx
Normal file
25
packages/cli/src/ui/components/ContextUsageDisplay.tsx
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { Text } from 'ink';
|
||||
import { Colors } from '../colors.js';
|
||||
import { tokenLimit } from '@qwen-code/qwen-code-core';
|
||||
|
||||
export const ContextUsageDisplay = ({
|
||||
promptTokenCount,
|
||||
model,
|
||||
}: {
|
||||
promptTokenCount: number;
|
||||
model: string;
|
||||
}) => {
|
||||
const percentage = promptTokenCount / tokenLimit(model);
|
||||
|
||||
return (
|
||||
<Text color={Colors.Gray}>
|
||||
({((1 - percentage) * 100).toFixed(0)}% context left)
|
||||
</Text>
|
||||
);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue