Merge branch 'master' of github.com:Mintplex-Labs/anything-llm

This commit is contained in:
timothycarambat 2025-07-08 14:29:54 -07:00
commit 8ea3c71b5e
3 changed files with 21 additions and 17 deletions

View File

@ -321,9 +321,10 @@ const Milvus = {
filterIdentifiers,
});
const sources = sourceDocuments.map((metadata, i) => {
return { ...metadata, text: contextTexts[i] };
const sources = sourceDocuments.map((doc, i) => {
return { metadata: doc, text: contextTexts[i] };
});
return {
contextTexts,
sources: this.curateSources(sources),
@ -358,7 +359,10 @@ const Milvus = {
}
result.contextTexts.push(match.metadata.text);
result.sourceDocuments.push(match);
result.sourceDocuments.push({
...match.metadata,
score: match.score,
});
result.scores.push(match.score);
});
return result;
@ -394,13 +398,10 @@ const Milvus = {
if (Object.keys(metadata).length > 0) {
documents.push({
...metadata,
...(source.hasOwnProperty("pageContent")
? { text: source.pageContent }
: {}),
...(source.text ? { text: source.text } : {}),
});
}
}
return documents;
},
};

View File

@ -67,7 +67,10 @@ const PineconeDB = {
}
result.contextTexts.push(match.metadata.text);
result.sourceDocuments.push(match);
result.sourceDocuments.push({
...match.metadata,
score: match.score,
});
result.scores.push(match.score);
});
@ -263,8 +266,8 @@ const PineconeDB = {
filterIdentifiers,
});
const sources = sourceDocuments.map((metadata, i) => {
return { ...metadata, text: contextTexts[i] };
const sources = sourceDocuments.map((doc, i) => {
return { metadata: doc, text: contextTexts[i] };
});
return {
contextTexts,
@ -285,7 +288,6 @@ const PineconeDB = {
});
}
}
return documents;
},
};

View File

@ -314,8 +314,8 @@ const Zilliz = {
filterIdentifiers,
});
const sources = sourceDocuments.map((metadata, i) => {
return { ...metadata, text: contextTexts[i] };
const sources = sourceDocuments.map((doc, i) => {
return { metadata: doc, text: contextTexts[i] };
});
return {
contextTexts,
@ -350,7 +350,10 @@ const Zilliz = {
return;
}
result.contextTexts.push(match.metadata.text);
result.sourceDocuments.push(match);
result.sourceDocuments.push({
...match.metadata,
score: match.score,
});
result.scores.push(match.score);
});
return result;
@ -386,9 +389,7 @@ const Zilliz = {
if (Object.keys(metadata).length > 0) {
documents.push({
...metadata,
...(source.hasOwnProperty("pageContent")
? { text: source.pageContent }
: {}),
...(source.text ? { text: source.text } : {}),
});
}
}