Add missing awaiters to getQueryText

This commit is contained in:
Cohee
2024-04-18 22:58:14 +03:00
parent cc1c3f173c
commit 16a2ac0bbe

View File

@@ -322,7 +322,7 @@ async function processFiles(chat) {
await vectorizeFile(fileText, fileName, collectionId); await vectorizeFile(fileText, fileName, collectionId);
} }
const queryText = getQueryText(chat); const queryText = await getQueryText(chat);
const fileChunks = await retrieveFileChunks(queryText, collectionId); const fileChunks = await retrieveFileChunks(queryText, collectionId);
// Wrap it back in a code block // Wrap it back in a code block
@@ -399,7 +399,7 @@ async function rearrangeChat(chat) {
return; return;
} }
const queryText = getQueryText(chat); const queryText = await getQueryText(chat);
if (queryText.length === 0) { if (queryText.length === 0) {
console.debug('Vectors: No text to query'); console.debug('Vectors: No text to query');
@@ -465,7 +465,7 @@ const onChatEvent = debounce(async () => await moduleWorker.update(), 500);
/** /**
* Gets the text to query from the chat * Gets the text to query from the chat
* @param {object[]} chat Chat messages * @param {object[]} chat Chat messages
* @returns {string} Text to query * @returns {Promise<string>} Text to query
*/ */
async function getQueryText(chat) { async function getQueryText(chat) {
let queryText = ''; let queryText = '';