mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 15:00:57 +03:00
add multiple loaders and documents
This commit is contained in:
@@ -27,7 +27,8 @@ class ChromaUpsert_VectorStores implements INode {
|
||||
{
|
||||
label: 'Document',
|
||||
name: 'document',
|
||||
type: 'Document'
|
||||
type: 'Document',
|
||||
list: true
|
||||
},
|
||||
{
|
||||
label: 'Embeddings',
|
||||
@@ -60,9 +61,10 @@ class ChromaUpsert_VectorStores implements INode {
|
||||
const embeddings = nodeData.inputs?.embeddings as Embeddings
|
||||
const output = nodeData.outputs?.output as string
|
||||
|
||||
const flattenDocs = docs.flat()
|
||||
const finalDocs = []
|
||||
for (let i = 0; i < docs.length; i += 1) {
|
||||
finalDocs.push(new Document(docs[i]))
|
||||
for (let i = 0; i < flattenDocs.length; i += 1) {
|
||||
finalDocs.push(new Document(flattenDocs[i]))
|
||||
}
|
||||
|
||||
const vectorStore = await Chroma.fromDocuments(finalDocs, embeddings, {
|
||||
|
||||
@@ -27,7 +27,8 @@ class InMemoryVectorStore_VectorStores implements INode {
|
||||
{
|
||||
label: 'Document',
|
||||
name: 'document',
|
||||
type: 'Document'
|
||||
type: 'Document',
|
||||
list: true
|
||||
},
|
||||
{
|
||||
label: 'Embeddings',
|
||||
@@ -54,9 +55,10 @@ class InMemoryVectorStore_VectorStores implements INode {
|
||||
const embeddings = nodeData.inputs?.embeddings as Embeddings
|
||||
const output = nodeData.outputs?.output as string
|
||||
|
||||
const flattenDocs = docs.flat()
|
||||
const finalDocs = []
|
||||
for (let i = 0; i < docs.length; i += 1) {
|
||||
finalDocs.push(new Document(docs[i]))
|
||||
for (let i = 0; i < flattenDocs.length; i += 1) {
|
||||
finalDocs.push(new Document(flattenDocs[i]))
|
||||
}
|
||||
|
||||
const vectorStore = await MemoryVectorStore.fromDocuments(finalDocs, embeddings)
|
||||
|
||||
@@ -28,7 +28,8 @@ class PineconeUpsert_VectorStores implements INode {
|
||||
{
|
||||
label: 'Document',
|
||||
name: 'document',
|
||||
type: 'Document'
|
||||
type: 'Document',
|
||||
list: true
|
||||
},
|
||||
{
|
||||
label: 'Embeddings',
|
||||
@@ -84,9 +85,10 @@ class PineconeUpsert_VectorStores implements INode {
|
||||
|
||||
const pineconeIndex = client.Index(index)
|
||||
|
||||
const flattenDocs = docs.flat()
|
||||
const finalDocs = []
|
||||
for (let i = 0; i < docs.length; i += 1) {
|
||||
finalDocs.push(new Document(docs[i]))
|
||||
for (let i = 0; i < flattenDocs.length; i += 1) {
|
||||
finalDocs.push(new Document(flattenDocs[i]))
|
||||
}
|
||||
|
||||
const obj: PineconeLibArgs = {
|
||||
|
||||
@@ -28,7 +28,8 @@ class SupabaseUpsert_VectorStores implements INode {
|
||||
{
|
||||
label: 'Document',
|
||||
name: 'document',
|
||||
type: 'Document'
|
||||
type: 'Document',
|
||||
list: true
|
||||
},
|
||||
{
|
||||
label: 'Embeddings',
|
||||
@@ -81,9 +82,10 @@ class SupabaseUpsert_VectorStores implements INode {
|
||||
|
||||
const client = createClient(supabaseProjUrl, supabaseApiKey)
|
||||
|
||||
const flattenDocs = docs.flat()
|
||||
const finalDocs = []
|
||||
for (let i = 0; i < docs.length; i += 1) {
|
||||
finalDocs.push(new Document(docs[i]))
|
||||
for (let i = 0; i < flattenDocs.length; i += 1) {
|
||||
finalDocs.push(new Document(flattenDocs[i]))
|
||||
}
|
||||
|
||||
const vectorStore = await SupabaseVectorStore.fromDocuments(finalDocs, embeddings, {
|
||||
|
||||
@@ -28,7 +28,8 @@ class WeaviateUpsert_VectorStores implements INode {
|
||||
{
|
||||
label: 'Document',
|
||||
name: 'document',
|
||||
type: 'Document'
|
||||
type: 'Document',
|
||||
list: true
|
||||
},
|
||||
{
|
||||
label: 'Embeddings',
|
||||
@@ -121,9 +122,10 @@ class WeaviateUpsert_VectorStores implements INode {
|
||||
|
||||
const client: WeaviateClient = weaviate.client(clientConfig)
|
||||
|
||||
const flattenDocs = docs.flat()
|
||||
const finalDocs = []
|
||||
for (let i = 0; i < docs.length; i += 1) {
|
||||
finalDocs.push(new Document(docs[i]))
|
||||
for (let i = 0; i < flattenDocs.length; i += 1) {
|
||||
finalDocs.push(new Document(flattenDocs[i]))
|
||||
}
|
||||
|
||||
const obj: WeaviateLibArgs = {
|
||||
|
||||
Reference in New Issue
Block a user