Vectors: escape file names

378dfd3626330dbb96a38f70e275ab3c41501e30

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

1 files changed, +3 -3Showing whitespace changes
public/scripts/extensions/vectors/index.js+3 -3
@@ -23,7 +23,7 @@ import {
23import { collapseNewlines, registerDebugFunction } from '../../power-user.js';23import { collapseNewlines, registerDebugFunction } from '../../power-user.js';
24import { SECRET_KEYS, secret_state, writeSecret } from '../../secrets.js';24import { SECRET_KEYS, secret_state, writeSecret } from '../../secrets.js';
25import { getDataBankAttachments, getDataBankAttachmentsForSource, getFileAttachment } from '../../chats.js';25import { getDataBankAttachments, getDataBankAttachmentsForSource, getFileAttachment } from '../../chats.js';
26import { debounce, getStringHash as calculateHash, waitUntilCondition, onlyUnique, splitRecursive, trimToStartSentence, trimToEndSentence } from '../../utils.js';26import { debounce, getStringHash as calculateHash, waitUntilCondition, onlyUnique, splitRecursive, trimToStartSentence, trimToEndSentence, escapeHtml } from '../../utils.js';
27import { debounce_timeout } from '../../constants.js';27import { debounce_timeout } from '../../constants.js';
28import { getSortedEntries } from '../../world-info.js';28import { getSortedEntries } from '../../world-info.js';
29import { textgen_types, textgenerationwebui_settings } from '../../textgen-settings.js';29import { textgen_types, textgenerationwebui_settings } from '../../textgen-settings.js';
@@ -565,7 +565,7 @@ async function vectorizeFile(fileText, fileName, collectionId, chunkSize, overla
565565
566 const batchSize = getBatchSize();566 const batchSize = getBatchSize();
567 const toastBody = $('<span>').text('This may take a while. Please wait...');567 const toastBody = $('<span>').text('This may take a while. Please wait...');
568 const toast = toastr.info(toastBody, `Ingesting file ${fileName}`, { closeButton: false, escapeHtml: false, timeOut: 0, extendedTimeOut: 0 });568 const toast = toastr.info(toastBody, `Ingesting file ${escapeHtml(fileName)}`, { closeButton: false, escapeHtml: false, timeOut: 0, extendedTimeOut: 0 });
569 const overlapSize = Math.round(chunkSize * overlapPercent / 100);569 const overlapSize = Math.round(chunkSize * overlapPercent / 100);
570 const delimiters = getChunkDelimiters();570 const delimiters = getChunkDelimiters();
571 // Overlap should not be included in chunk size. It will be later compensated by overlapChunks571 // Overlap should not be included in chunk size. It will be later compensated by overlapChunks
@@ -1060,7 +1060,7 @@ async function onViewStatsClick() {
1060 toastr.info(`Total hashes: <b>${totalHashes}</b><br>1060 toastr.info(`Total hashes: <b>${totalHashes}</b><br>
1061 Unique hashes: <b>${uniqueHashes}</b><br><br>1061 Unique hashes: <b>${uniqueHashes}</b><br><br>
1062 I'll mark collected messages with a green circle.`,1062 I'll mark collected messages with a green circle.`,
1063 `Stats for chat ${chatId}`,1063 `Stats for chat ${escapeHtml(chatId)}`,
1064 { timeOut: 10000, escapeHtml: false },1064 { timeOut: 10000, escapeHtml: false },
1065 );1065 );
10661066