feat: improve token counter display (#439)
Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
@@ -395,6 +395,8 @@ export function onChunk(b: Buffers, chunk: LettaStreamingResponse) {
|
||||
argsText: (line.argsText || "") + argsText,
|
||||
};
|
||||
b.byId.set(id, updatedLine);
|
||||
// Count tool call arguments as LLM output tokens
|
||||
b.tokenCount += argsText.length;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ export const INTERRUPTED_BY_USER = "Interrupted by user";
|
||||
/**
|
||||
* Status bar thresholds - only show indicators when values exceed these
|
||||
*/
|
||||
// Show token count after 1000 estimated tokens
|
||||
export const TOKEN_DISPLAY_THRESHOLD = 1000;
|
||||
// Show token count after 100 estimated tokens (shows exact count until 1k, then compact)
|
||||
export const TOKEN_DISPLAY_THRESHOLD = 100;
|
||||
// Show elapsed time after 2 minutes (in ms)
|
||||
export const ELAPSED_DISPLAY_THRESHOLD_MS = 2 * 60 * 1000;
|
||||
|
||||
Reference in New Issue
Block a user