From 07ac2460e2277d02a008917fa4777bffb8aee821 Mon Sep 17 00:00:00 2001
From: Cohee <18619528+Cohee1207@users.noreply.github.com>
Date: Tue, 16 Jul 2024 22:51:15 +0300
Subject: [PATCH] Add vector storage to prompt itemization
---
public/script.js | 4 ++++
public/scripts/templates/itemizationChat.html | 8 ++++++++
public/scripts/templates/itemizationText.html | 8 ++++++++
3 files changed, 20 insertions(+)
diff --git a/public/script.js b/public/script.js
index e800c67a9..6e3026d9a 100644
--- a/public/script.js
+++ b/public/script.js
@@ -4183,6 +4183,8 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
summarizeString: (extension_prompts['1_memory']?.value || ''),
authorsNoteString: (extension_prompts['2_floating_prompt']?.value || ''),
smartContextString: (extension_prompts['chromadb']?.value || ''),
+ chatVectorsString: (extension_prompts['3_vectors']?.value || ''),
+ dataBankVectorsString: (extension_prompts['4_vectors_data_bank']?.value || ''),
worldInfoString: worldInfoString,
storyString: storyString,
beforeScenarioAnchor: beforeScenarioAnchor,
@@ -4814,6 +4816,8 @@ export async function itemizedParams(itemizedPrompts, thisPromptSet) {
thisPrompt_padding: itemizedPrompts[thisPromptSet].padding,
this_main_api: itemizedPrompts[thisPromptSet].main_api,
chatInjects: await getTokenCountAsync(itemizedPrompts[thisPromptSet].chatInjects),
+ chatVectorsStringTokens: await getTokenCountAsync(itemizedPrompts[thisPromptSet].chatVectorsString),
+ dataBankVectorsStringTokens: await getTokenCountAsync(itemizedPrompts[thisPromptSet].dataBankVectorsString),
};
if (params.chatInjects) {
diff --git a/public/scripts/templates/itemizationChat.html b/public/scripts/templates/itemizationChat.html
index 839a96618..dc33ba7e0 100644
--- a/public/scripts/templates/itemizationChat.html
+++ b/public/scripts/templates/itemizationChat.html
@@ -107,6 +107,14 @@ API Used: {{this_main_api}}