Simplify token threshold warnings

This commit is contained in:
maver 2023-06-27 20:53:50 +02:00
parent 49cb682499
commit 2054cbeb83

View File

@ -767,11 +767,10 @@ PromptManagerModule.prototype.renderPromptManagerListItems = function () {
let warningTitle = '';
const tokenBudget = this.serviceSettings.openai_max_context - this.serviceSettings.openai_max_tokens;
const tokenThreshold = tokenBudget * 0.9;
if (this.tokenCache >= tokenThreshold &&
if (
'chatHistory' === prompt.identifier) {
const warningThreshold = tokenBudget * 0.50;
const dangerThreshold = tokenBudget * 0.30;
const warningThreshold = tokenBudget * 0.60;
const dangerThreshold = tokenBudget * 0.35;
if (tokens <= dangerThreshold) {
warningClass = 'fa-solid tooltip fa-triangle-exclamation text_danger';