Fix vectorize all with no chat selected
This commit is contained in:
parent
17367f2b17
commit
c9d8d7ba64
|
@ -27,6 +27,12 @@ async function onVectorizeAllClick() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const chatId = getCurrentChatId();
|
const chatId = getCurrentChatId();
|
||||||
|
|
||||||
|
if (!chatId) {
|
||||||
|
toastr.info('No chat selected', 'Vectorization aborted');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const batchSize = 5;
|
const batchSize = 5;
|
||||||
const elapsedLog = [];
|
const elapsedLog = [];
|
||||||
let finished = false;
|
let finished = false;
|
||||||
|
@ -89,7 +95,7 @@ async function synchronizeChat(batchSize = 5) {
|
||||||
|
|
||||||
if (!chatId || !Array.isArray(context.chat)) {
|
if (!chatId || !Array.isArray(context.chat)) {
|
||||||
console.debug('Vectors: No chat selected');
|
console.debug('Vectors: No chat selected');
|
||||||
return;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const hashedMessages = context.chat.filter(x => !x.is_system).map(x => ({ text: String(x.mes), hash: getStringHash(x.mes) }));
|
const hashedMessages = context.chat.filter(x => !x.is_system).map(x => ({ text: String(x.mes), hash: getStringHash(x.mes) }));
|
||||||
|
|
Loading…
Reference in New Issue