Display API and model used in itemization
| @@ -4941,7 +4941,7 @@ async function duplicateCharacter() { | |||
| 4941 | return ''; | 4941 | return ''; |
| 4942 | } | 4942 | } |
| 4943 | 4943 | ||
| 4944 | export async function itemizedParams(itemizedPrompts, thisPromptSet) { | 4944 | export async function itemizedParams(itemizedPrompts, thisPromptSet, incomingMesId) { |
| 4945 | const params = { | 4945 | const params = { |
| 4946 | charDescriptionTokens: await getTokenCountAsync(itemizedPrompts[thisPromptSet].charDescription), | 4946 | charDescriptionTokens: await getTokenCountAsync(itemizedPrompts[thisPromptSet].charDescription), |
| 4947 | charPersonalityTokens: await getTokenCountAsync(itemizedPrompts[thisPromptSet].charPersonality), | 4947 | charPersonalityTokens: await getTokenCountAsync(itemizedPrompts[thisPromptSet].charPersonality), |
| @@ -4960,8 +4960,20 @@ export async function itemizedParams(itemizedPrompts, thisPromptSet) { | |||
| 4960 | chatInjects: await getTokenCountAsync(itemizedPrompts[thisPromptSet].chatInjects), | 4960 | chatInjects: await getTokenCountAsync(itemizedPrompts[thisPromptSet].chatInjects), |
| 4961 | chatVectorsStringTokens: await getTokenCountAsync(itemizedPrompts[thisPromptSet].chatVectorsString), | 4961 | chatVectorsStringTokens: await getTokenCountAsync(itemizedPrompts[thisPromptSet].chatVectorsString), |
| 4962 | dataBankVectorsStringTokens: await getTokenCountAsync(itemizedPrompts[thisPromptSet].dataBankVectorsString), | 4962 | dataBankVectorsStringTokens: await getTokenCountAsync(itemizedPrompts[thisPromptSet].dataBankVectorsString), |
| 4963 | modelUsed: chat[incomingMesId]?.extra?.model, | ||
| 4964 | apiUsed: chat[incomingMesId]?.extra?.api, | ||
| 4963 | }; | 4965 | }; |
| 4964 | 4966 | ||
| 4967 | const getFriendlyName = (value) => $(`#rm_api_block select option[value="${value}"]`).first().text() || value; | ||
| 4968 | |||
| 4969 | if (params.apiUsed) { | ||
| 4970 | params.apiUsed = getFriendlyName(params.apiUsed); | ||
| 4971 | } | ||
| 4972 | |||
| 4973 | if (params.this_main_api) { | ||
| 4974 | params.mainApiFriendlyName = getFriendlyName(params.this_main_api); | ||
| 4975 | } | ||
| 4976 | |||
| 4965 | if (params.chatInjects) { | 4977 | if (params.chatInjects) { |
| 4966 | params.ActualChatHistoryTokens = params.ActualChatHistoryTokens - params.chatInjects; | 4978 | params.ActualChatHistoryTokens = params.ActualChatHistoryTokens - params.chatInjects; |
| 4967 | } | 4979 | } |
| @@ -5076,7 +5088,7 @@ async function promptItemize(itemizedPrompts, requestedMesId) { | |||
| 5076 | return null; | 5088 | return null; |
| 5077 | } | 5089 | } |
| 5078 | 5090 | ||
| 5079 | const params = await itemizedParams(itemizedPrompts, thisPromptSet); | 5091 | const params = await itemizedParams(itemizedPrompts, thisPromptSet, incomingMesId); |
| 5080 | const flatten = (rawPrompt) => Array.isArray(rawPrompt) ? rawPrompt.map(x => x.content).join('\n') : rawPrompt; | 5092 | const flatten = (rawPrompt) => Array.isArray(rawPrompt) ? rawPrompt.map(x => x.content).join('\n') : rawPrompt; |
| 5081 | 5093 | ||
| 5082 | const template = params.this_main_api == 'openai' | 5094 | const template = params.this_main_api == 'openai' |
| @@ -4,8 +4,8 @@ | |||
| 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> |
| 7 | API/Model Used: {{mainApiFriendlyName}} {{#if apiUsed}}({{apiUsed}}){{/if}} {{#if modelUsed}}– {{modelUsed}}{{/if}}<br> | ||
| 7 | Tokenizer: {{selectedTokenizer}}<br> | 8 | Tokenizer: {{selectedTokenizer}}<br> |
| 8 | API Used: {{this_main_api}}<br> | ||
| 9 | <span class="tokenItemizingSubclass"> | 9 | <span class="tokenItemizingSubclass"> |
| 10 | Only the white numbers really matter. All numbers are estimates. | 10 | 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. | 11 | Grey color items may not have been included in the context due to certain prompt format settings. |
| @@ -4,8 +4,8 @@ | |||
| 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> |
| 7 | API/Model Used: {{mainApiFriendlyName}} {{#if apiUsed}}({{apiUsed}}){{/if}} {{#if modelUsed}}– {{modelUsed}}{{/if}}<br> | ||
| 7 | Tokenizer: {{selectedTokenizer}}<br> | 8 | Tokenizer: {{selectedTokenizer}}<br> |
| 8 | API Used: {{this_main_api}}<br> | ||
| 9 | <span class="tokenItemizingSubclass"> | 9 | <span class="tokenItemizingSubclass"> |
| 10 | Only the white numbers really matter. All numbers are estimates. | 10 | 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. | 11 | Grey color items may not have been included in the context due to certain prompt format settings. |