Negotiate formatting with VS Code autoformat

This commit is contained in:
Cohee
2023-12-04 20:59:11 +02:00
parent 5f1bed1e70
commit 3ad7d5d520

View File

@@ -4154,11 +4154,11 @@ async function DupeChar() {
return; return;
} }
const confirm = await callPopup(` const confirmMessage = `
<h3>Are you sure you want to duplicate this character?</h3> <h3>Are you sure you want to duplicate this character?</h3>
<span>If you just want to start a new chat with the same character, use "Start new chat" option in the bottom-left options menu.</span><br><br>`, <span>If you just want to start a new chat with the same character, use "Start new chat" option in the bottom-left options menu.</span><br><br>`;
'confirm',
); const confirm = await callPopup(confirmMessage, 'confirm');
if (!confirm) { if (!confirm) {
console.log('User cancelled duplication'); console.log('User cancelled duplication');
@@ -7631,10 +7631,7 @@ function doTogglePanels() {
} }
function addDebugFunctions() { function addDebugFunctions() {
registerDebugFunction('backfillTokenCounts', 'Backfill token counters', const doBackfill = async () => {
`Recalculates token counts of all messages in the current chat to refresh the counters.
Useful when you switch between models that have different tokenizers.
This is a visual change only. Your chat will be reloaded.`, async () => {
for (const message of chat) { for (const message of chat) {
// System messages are not counted // System messages are not counted
if (message.is_system) { if (message.is_system) {
@@ -7650,7 +7647,12 @@ function addDebugFunctions() {
await saveChatConditional(); await saveChatConditional();
await reloadCurrentChat(); await reloadCurrentChat();
}); };
registerDebugFunction('backfillTokenCounts', 'Backfill token counters',
`Recalculates token counts of all messages in the current chat to refresh the counters.
Useful when you switch between models that have different tokenizers.
This is a visual change only. Your chat will be reloaded.`, doBackfill);
registerDebugFunction('generationTest', 'Send a generation request', 'Generates text using the currently selected API.', async () => { registerDebugFunction('generationTest', 'Send a generation request', 'Generates text using the currently selected API.', async () => {
const text = prompt('Input text:', 'Hello'); const text = prompt('Input text:', 'Hello');