mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 19:00:59 +03:00
change flat to flatten from lodash
This commit is contained in:
@@ -3,6 +3,7 @@ import { Embeddings } from 'langchain/embeddings/base'
|
||||
import { Document } from 'langchain/document'
|
||||
import { getBaseClasses } from '../../../src/utils'
|
||||
import { FaissStore } from 'langchain/vectorstores/faiss'
|
||||
import { flatten } from 'lodash'
|
||||
|
||||
class FaissUpsert_VectorStores implements INode {
|
||||
label: string
|
||||
@@ -63,7 +64,7 @@ class FaissUpsert_VectorStores implements INode {
|
||||
const output = nodeData.outputs?.output as string
|
||||
const basePath = nodeData.inputs?.basePath as string
|
||||
|
||||
const flattenDocs = docs && docs.length ? docs.flat() : []
|
||||
const flattenDocs = docs && docs.length ? flatten(docs) : []
|
||||
const finalDocs = []
|
||||
for (let i = 0; i < flattenDocs.length; i += 1) {
|
||||
finalDocs.push(new Document(flattenDocs[i]))
|
||||
|
||||
Reference in New Issue
Block a user