File tree Expand file tree Collapse file tree
ui/src/components/editor/panel/ContextUtilisation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ const format_tokens = (tokens: number): string => {
1111 return tokens . toString ( )
1212 }
1313 const k = Math . round ( tokens / 1000 )
14- return k . toString ( ) + 'k '
14+ return k . toString ( ) + 'K '
1515}
1616
1717export const ContextUtilisation : React . FC < Props > = ( props ) => {
@@ -39,7 +39,8 @@ export const ContextUtilisation: React.FC<Props> = (props) => {
3939 if ( ! is_above_threshold ) {
4040 const remaining_tokens =
4141 props . context_size_warning_threshold - props . current_context_size
42- title_text = `${ remaining_tokens } tokens remaining until threshold (${ formatted_threshold } )`
42+ const formatted_remaining_tokens = format_tokens ( remaining_tokens )
43+ title_text = `${ formatted_remaining_tokens } tokens remaining until threshold`
4344 } else {
4445 title_text = `Context size (${ formatted_current_size } ) exceeds threshold (${ formatted_threshold } )`
4546 }
Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ export const context_initialization = (
8585 )
8686 const formatted_threshold =
8787 threshold >= 1000
88- ? `${ Math . round ( threshold / 1000 ) } k `
88+ ? `${ Math . round ( threshold / 1000 ) } K `
8989 : `${ threshold } `
9090 vscode . window . showWarningMessage (
9191 dictionary . warning_message . CONTEXT_SIZE_WARNING (
Original file line number Diff line number Diff line change 11export function display_token_count ( token_count : number ) : string {
22 if ( token_count >= 1000 ) {
3- return `${ Math . floor ( token_count / 1000 ) } k `
3+ return `${ Math . floor ( token_count / 1000 ) } K `
44 }
55 return `${ token_count } `
66}
You can’t perform that action at this time.
0 commit comments