Show used preset in itemization dialog

69da293fb9cbe83e1e5d5c87a7ad1ffdfbff49fd

Cohee <18619528+Cohee1207@users.noreply.github.com>

3 files changed, +25 -5Showing whitespace changes
public/script.js+3 -1
@@ -241,7 +241,7 @@ import { hideLoader, showLoader } from './scripts/loader.js';
241import { BulkEditOverlay, CharacterContextMenu } from './scripts/BulkEditOverlay.js';241import { BulkEditOverlay, CharacterContextMenu } from './scripts/BulkEditOverlay.js';
242import { loadFeatherlessModels, loadMancerModels, loadOllamaModels, loadTogetherAIModels, loadInfermaticAIModels, loadOpenRouterModels, loadVllmModels, loadAphroditeModels, loadDreamGenModels, initTextGenModels, loadTabbyModels } from './scripts/textgen-models.js';242import { loadFeatherlessModels, loadMancerModels, loadOllamaModels, loadTogetherAIModels, loadInfermaticAIModels, loadOpenRouterModels, loadVllmModels, loadAphroditeModels, loadDreamGenModels, initTextGenModels, loadTabbyModels } from './scripts/textgen-models.js';
243import { appendFileContent, hasPendingFileAttachment, populateFileAttachment, decodeStyleTags, encodeStyleTags, isExternalMediaAllowed, getCurrentEntityId, preserveNeutralChat, restoreNeutralChat } from './scripts/chats.js';243import { appendFileContent, hasPendingFileAttachment, populateFileAttachment, decodeStyleTags, encodeStyleTags, isExternalMediaAllowed, getCurrentEntityId, preserveNeutralChat, restoreNeutralChat } from './scripts/chats.js';
244import { initPresetManager } from './scripts/preset-manager.js';244import { getPresetManager, initPresetManager } from './scripts/preset-manager.js';
245import { MacrosParser, evaluateMacros, getLastMessageId, initMacros } from './scripts/macros.js';245import { MacrosParser, evaluateMacros, getLastMessageId, initMacros } from './scripts/macros.js';
246import { currentUser, setUserControls } from './scripts/user.js';246import { currentUser, setUserControls } from './scripts/user.js';
247import { POPUP_RESULT, POPUP_TYPE, Popup, callGenericPopup, fixToastrForDialogs } from './scripts/popup.js';247import { POPUP_RESULT, POPUP_TYPE, Popup, callGenericPopup, fixToastrForDialogs } from './scripts/popup.js';
@@ -4494,6 +4494,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
4494 instruction: main_api !== 'openai' && power_user.sysprompt.enabled ? substituteParams(power_user.prefer_character_prompt && system ? system : power_user.sysprompt.content) : '',4494 instruction: main_api !== 'openai' && power_user.sysprompt.enabled ? substituteParams(power_user.prefer_character_prompt && system ? system : power_user.sysprompt.content) : '',
4495 userPersona: (power_user.persona_description_position == persona_description_positions.IN_PROMPT ? (persona || '') : ''),4495 userPersona: (power_user.persona_description_position == persona_description_positions.IN_PROMPT ? (persona || '') : ''),
4496 tokenizer: getFriendlyTokenizerName(main_api).tokenizerName || '',4496 tokenizer: getFriendlyTokenizerName(main_api).tokenizerName || '',
4497 presetName: getPresetManager()?.getSelectedPresetName() || '',
4497 };4498 };
44984499
4499 //console.log(additionalPromptStuff);4500 //console.log(additionalPromptStuff);
@@ -5160,6 +5161,7 @@ export async function itemizedParams(itemizedPrompts, thisPromptSet, incomingMes
5160 dataBankVectorsStringTokens: await getTokenCountAsync(itemizedPrompts[thisPromptSet].dataBankVectorsString),5161 dataBankVectorsStringTokens: await getTokenCountAsync(itemizedPrompts[thisPromptSet].dataBankVectorsString),
5161 modelUsed: chat[incomingMesId]?.extra?.model,5162 modelUsed: chat[incomingMesId]?.extra?.model,
5162 apiUsed: chat[incomingMesId]?.extra?.api,5163 apiUsed: chat[incomingMesId]?.extra?.api,
5164 presetName: itemizedPrompts[thisPromptSet].presetName || t`(Unknown)`,
5163 };5165 };
51645166
5165 const getFriendlyName = (value) => $(`#rm_api_block select option[value="${value}"]`).first().text() || value;5167 const getFriendlyName = (value) => $(`#rm_api_block select option[value="${value}"]`).first().text() || value;
public/scripts/templates/itemizationChat.html+11 -2
@@ -4,8 +4,17 @@
4 <div id="copyPromptToClipboard" class="fa-solid fa-copy menu_button" title="Copy Prompt" data-i18n="[title]Copy Prompt"></div>4 <div id="copyPromptToClipboard" class="fa-solid fa-copy menu_button" title="Copy Prompt" data-i18n="[title]Copy Prompt"></div>
5 <div id="diffPrevPrompt" class="fa-solid fa-code-compare menu_button" title="Show Prompt Differences" data-i18n="[title]Show Prompt Differences"></div>5 <div id="diffPrevPrompt" class="fa-solid fa-code-compare menu_button" title="Show Prompt Differences" data-i18n="[title]Show Prompt Differences"></div>
6</h3>6</h3>
7API/Model Used: {{mainApiFriendlyName}} {{#if apiUsed}}({{apiUsed}}){{/if}} {{#if modelUsed}}&ndash; {{modelUsed}}{{/if}}<br>7<div>
8Tokenizer: {{selectedTokenizer}}<br>8 <div>
9 API/Model: {{mainApiFriendlyName}} {{#if apiUsed}}({{apiUsed}}){{/if}} {{#if modelUsed}}&ndash; {{modelUsed}}{{/if}}
10 </div>
11 <div>
12 <small>Preset: {{presetName}}</small>
13 <span>|</span>
14 <small>Tokenizer: {{selectedTokenizer}}</small>
15 </div>
16</div>
17
9<span class="tokenItemizingSubclass">18<span class="tokenItemizingSubclass">
10 Only the white numbers really matter. All numbers are estimates.19 Only the white numbers really matter. All numbers are estimates.
11 Grey color items may not have been included in the context due to certain prompt format settings.20 Grey color items may not have been included in the context due to certain prompt format settings.
public/scripts/templates/itemizationText.html+11 -2
@@ -4,8 +4,17 @@
4 <div id="copyPromptToClipboard" class="fa-solid fa-copy menu_button" title="Copy Prompt" data-i18n="[title]Copy Prompt"></div>4 <div id="copyPromptToClipboard" class="fa-solid fa-copy menu_button" title="Copy Prompt" data-i18n="[title]Copy Prompt"></div>
5 <div id="diffPrevPrompt" class="fa-solid fa-code-compare menu_button" title="Show Prompt Differences" data-i18n="[title]Show Prompt Differences"></div>5 <div id="diffPrevPrompt" class="fa-solid fa-code-compare menu_button" title="Show Prompt Differences" data-i18n="[title]Show Prompt Differences"></div>
6</h3>6</h3>
7API/Model Used: {{mainApiFriendlyName}} {{#if apiUsed}}({{apiUsed}}){{/if}} {{#if modelUsed}}&ndash; {{modelUsed}}{{/if}}<br>7<div>
8Tokenizer: {{selectedTokenizer}}<br>8 <div>
9 API/Model: {{mainApiFriendlyName}} {{#if apiUsed}}({{apiUsed}}){{/if}} {{#if modelUsed}}&ndash; {{modelUsed}}{{/if}}
10 </div>
11 <div>
12 <small>Preset: {{presetName}}</small>
13 <span>|</span>
14 <small>Tokenizer: {{selectedTokenizer}}</small>
15 </div>
16</div>
17
9<span class="tokenItemizingSubclass">18<span class="tokenItemizingSubclass">
10 Only the white numbers really matter. All numbers are estimates.19 Only the white numbers really matter. All numbers are estimates.
11 Grey color items may not have been included in the context due to certain prompt format settings.20 Grey color items may not have been included in the context due to certain prompt format settings.