fix: adjust return type of addDocuments in case of no additions (#353)

This commit is contained in:
Tobias Landenberger 2023-11-10 22:27:53 +01:00 committed by GitHub
parent 6e72519caf
commit 2914c09dd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,7 +36,7 @@ const Document = {
addDocuments: async function (workspace, additions = []) {
const VectorDb = getVectorDbClass();
if (additions.length === 0) return;
if (additions.length === 0) return { failed: [], embedded: [] };
const embedded = [];
const failedToEmbed = [];