From 4d08e3e9be33a5f51fed03712a3adc76a415c848 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sat, 9 Sep 2023 15:12:54 +0300 Subject: [PATCH] Decrease batch size. Add browser console log --- public/scripts/extensions/vectors/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/public/scripts/extensions/vectors/index.js b/public/scripts/extensions/vectors/index.js index 7ad0c6fb3..a364ea8a4 100644 --- a/public/scripts/extensions/vectors/index.js +++ b/public/scripts/extensions/vectors/index.js @@ -59,7 +59,7 @@ async function onVectorizeAllClick() { } } -async function synchronizeChat(batchSize = 10) { +async function synchronizeChat(batchSize = 5) { try { if (!settings.enabled) { return -1; @@ -181,8 +181,10 @@ async function rearrangeChat(chat) { } // Format queried messages into a single string - const queriedText = 'Past events: ' + queriedMessages.map(x => collapseNewlines(`${x.name}: ${x.mes}`).trim()).join('\n\n'); - setExtensionPrompt(EXTENSION_PROMPT_TAG, queriedText, extension_prompt_types.IN_PROMPT, 0); + const queriedText = queriedMessages.map(x => collapseNewlines(`${x.name}: ${x.mes}`).trim()).join('\n\n'); + console.log('Vectors: relevant past messages found.\n', queriedText); + const insertedText = `Past events: ${queriedText}`; + setExtensionPrompt(EXTENSION_PROMPT_TAG, insertedText, extension_prompt_types.IN_PROMPT, 0); } catch (error) { console.error('Vectors: Failed to rearrange chat', error); }