mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 19:00:59 +03:00
Merge pull request #1127 from chz8494/memory_replace_fix
[Bug] Fix Cannot read properties of undefined (reading 'replace')
This commit is contained in:
@@ -71,7 +71,9 @@ class InMemoryVectorStore_VectorStores implements INode {
|
|||||||
const flattenDocs = docs && docs.length ? flatten(docs) : []
|
const flattenDocs = docs && docs.length ? flatten(docs) : []
|
||||||
const finalDocs = []
|
const finalDocs = []
|
||||||
for (let i = 0; i < flattenDocs.length; i += 1) {
|
for (let i = 0; i < flattenDocs.length; i += 1) {
|
||||||
finalDocs.push(new Document(flattenDocs[i]))
|
if (flattenDocs[i] !== undefined && flattenDocs[i].pageContent !== undefined) {
|
||||||
|
finalDocs.push(new Document(flattenDocs[i]))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const vectorStore = await MemoryVectorStore.fromDocuments(finalDocs, embeddings)
|
const vectorStore = await MemoryVectorStore.fromDocuments(finalDocs, embeddings)
|
||||||
|
|||||||
Reference in New Issue
Block a user