mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-09 08:38:53 +01:00
Display API and model used in itemization
This commit is contained in:
parent
75e279091c
commit
725aff3474
@ -4941,7 +4941,7 @@ async function duplicateCharacter() {
|
||||
return '';
|
||||
}
|
||||
|
||||
export async function itemizedParams(itemizedPrompts, thisPromptSet) {
|
||||
export async function itemizedParams(itemizedPrompts, thisPromptSet, incomingMesId) {
|
||||
const params = {
|
||||
charDescriptionTokens: await getTokenCountAsync(itemizedPrompts[thisPromptSet].charDescription),
|
||||
charPersonalityTokens: await getTokenCountAsync(itemizedPrompts[thisPromptSet].charPersonality),
|
||||
@ -4960,8 +4960,20 @@ export async function itemizedParams(itemizedPrompts, thisPromptSet) {
|
||||
chatInjects: await getTokenCountAsync(itemizedPrompts[thisPromptSet].chatInjects),
|
||||
chatVectorsStringTokens: await getTokenCountAsync(itemizedPrompts[thisPromptSet].chatVectorsString),
|
||||
dataBankVectorsStringTokens: await getTokenCountAsync(itemizedPrompts[thisPromptSet].dataBankVectorsString),
|
||||
modelUsed: chat[incomingMesId]?.extra?.model,
|
||||
apiUsed: chat[incomingMesId]?.extra?.api,
|
||||
};
|
||||
|
||||
const getFriendlyName = (value) => $(`#rm_api_block select option[value="${value}"]`).first().text() || value;
|
||||
|
||||
if (params.apiUsed) {
|
||||
params.apiUsed = getFriendlyName(params.apiUsed);
|
||||
}
|
||||
|
||||
if (params.this_main_api) {
|
||||
params.mainApiFriendlyName = getFriendlyName(params.this_main_api);
|
||||
}
|
||||
|
||||
if (params.chatInjects) {
|
||||
params.ActualChatHistoryTokens = params.ActualChatHistoryTokens - params.chatInjects;
|
||||
}
|
||||
@ -5076,7 +5088,7 @@ async function promptItemize(itemizedPrompts, requestedMesId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const params = await itemizedParams(itemizedPrompts, thisPromptSet);
|
||||
const params = await itemizedParams(itemizedPrompts, thisPromptSet, incomingMesId);
|
||||
const flatten = (rawPrompt) => Array.isArray(rawPrompt) ? rawPrompt.map(x => x.content).join('\n') : rawPrompt;
|
||||
|
||||
const template = params.this_main_api == 'openai'
|
||||
|
@ -4,8 +4,8 @@
|
||||
<div id="copyPromptToClipboard" class="fa-solid fa-copy menu_button" title="Copy Prompt" data-i18n="[title]Copy Prompt"></div>
|
||||
<div id="diffPrevPrompt" class="fa-solid fa-code-compare menu_button" title="Show Prompt Differences" data-i18n="[title]Show Prompt Differences"></div>
|
||||
</h3>
|
||||
API/Model Used: {{mainApiFriendlyName}} {{#if apiUsed}}({{apiUsed}}){{/if}} {{#if modelUsed}}– {{modelUsed}}{{/if}}<br>
|
||||
Tokenizer: {{selectedTokenizer}}<br>
|
||||
API Used: {{this_main_api}}<br>
|
||||
<span class="tokenItemizingSubclass">
|
||||
Only the white numbers really matter. All numbers are estimates.
|
||||
Grey color items may not have been included in the context due to certain prompt format settings.
|
||||
|
@ -4,8 +4,8 @@
|
||||
<div id="copyPromptToClipboard" class="fa-solid fa-copy menu_button" title="Copy Prompt" data-i18n="[title]Copy Prompt"></div>
|
||||
<div id="diffPrevPrompt" class="fa-solid fa-code-compare menu_button" title="Show Prompt Differences" data-i18n="[title]Show Prompt Differences"></div>
|
||||
</h3>
|
||||
API/Model Used: {{mainApiFriendlyName}} {{#if apiUsed}}({{apiUsed}}){{/if}} {{#if modelUsed}}– {{modelUsed}}{{/if}}<br>
|
||||
Tokenizer: {{selectedTokenizer}}<br>
|
||||
API Used: {{this_main_api}}<br>
|
||||
<span class="tokenItemizingSubclass">
|
||||
Only the white numbers really matter. All numbers are estimates.
|
||||
Grey color items may not have been included in the context due to certain prompt format settings.
|
||||
|
Loading…
x
Reference in New Issue
Block a user