mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 12:40:44 +00:00
Merge branch 'main' into feature/add-context-window-size-config
Resolved conflicts in: - packages/cli/src/ui/components/ContextUsageDisplay.tsx - packages/cli/src/ui/components/Footer.tsx - packages/cli/src/ui/components/Footer.test.tsx - docs/users/configuration/settings.md Changes: - Merged main branch UI improvements with rightItems architecture - Updated contextWindowSize documentation to be more concise - Preserved all main branch features and functionality
This commit is contained in:
commit
4ad4aab3fd
320 changed files with 21383 additions and 10420 deletions
|
|
@ -19,17 +19,21 @@ export const ContextUsageDisplay = ({
|
|||
terminalWidth: number;
|
||||
config: Config;
|
||||
}) => {
|
||||
if (promptTokenCount === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const contentGeneratorConfig = config.getContentGeneratorConfig();
|
||||
const contextLimit = tokenLimit(model, 'input', contentGeneratorConfig);
|
||||
const percentage = promptTokenCount / contextLimit;
|
||||
const percentageLeft = ((1 - percentage) * 100).toFixed(0);
|
||||
const percentageUsed = (percentage * 100).toFixed(1);
|
||||
|
||||
const label = terminalWidth < 100 ? '%' : '% context left';
|
||||
const label = terminalWidth < 100 ? '% used' : '% context used';
|
||||
|
||||
return (
|
||||
<Text color={theme.text.secondary}>
|
||||
({percentageLeft}
|
||||
{label})
|
||||
{percentageUsed}
|
||||
{label}
|
||||
</Text>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue