mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 19:00:59 +03:00
Feature/s3 storage (#2226)
* centralizing file writing.... * allowing s3 as storage option * allowing s3 as storage option * update s3 storage --------- Co-authored-by: Henry <hzj94@hotmail.com>
This commit is contained in:
@@ -11,9 +11,7 @@ import { Document } from '@langchain/core/documents'
|
||||
import { Embeddings } from '@langchain/core/embeddings'
|
||||
import { ICommonObject, INode, INodeData, INodeOutputsValue, INodeParams, IndexingResult } from '../../../src/Interface'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { getStoragePath } from '../../../src'
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
import { getFileFromStorage } from '../../../src'
|
||||
|
||||
class Vectara_VectorStores implements INode {
|
||||
label: string
|
||||
@@ -197,8 +195,7 @@ class Vectara_VectorStores implements INode {
|
||||
const chatflowid = options.chatflowid
|
||||
|
||||
for (const file of files) {
|
||||
const fileInStorage = path.join(getStoragePath(), chatflowid, file)
|
||||
const fileData = fs.readFileSync(fileInStorage)
|
||||
const fileData = await getFileFromStorage(file, chatflowid)
|
||||
const blob = new Blob([fileData])
|
||||
vectaraFiles.push({ blob: blob, fileName: getFileName(file) })
|
||||
}
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import { VectaraStore, VectaraLibArgs, VectaraFilter, VectaraContextConfig, VectaraFile } from '@langchain/community/vectorstores/vectara'
|
||||
import { ICommonObject, INode, INodeData, INodeOutputsValue, INodeParams } from '../../../src/Interface'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import path from 'path'
|
||||
import { getStoragePath } from '../../../src'
|
||||
import fs from 'fs'
|
||||
import { getFileFromStorage } from '../../../src'
|
||||
|
||||
class VectaraUpload_VectorStores implements INode {
|
||||
label: string
|
||||
@@ -144,8 +142,7 @@ class VectaraUpload_VectorStores implements INode {
|
||||
const chatflowid = options.chatflowid
|
||||
|
||||
for (const file of files) {
|
||||
const fileInStorage = path.join(getStoragePath(), chatflowid, file)
|
||||
const fileData = fs.readFileSync(fileInStorage)
|
||||
const fileData = await getFileFromStorage(file, chatflowid)
|
||||
const blob = new Blob([fileData])
|
||||
vectaraFiles.push({ blob: blob, fileName: getFileName(file) })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user