mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-29 01:01:11 +03:00
Feature/Add bullmq redis for message queue processing (#3568)
* add bullmq redis for message queue processing * Update pnpm-lock.yaml * update queue manager * remove singleton patterns, add redis to cache pool * add bull board ui * update rate limit handler * update redis configuration * Merge add rate limit redis prefix * update rate limit queue events * update preview loader to queue * refractor namings to constants * update env variable for queue * update worker shutdown gracefully
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { flatten, isEqual } from 'lodash'
|
||||
import { Pinecone, PineconeConfiguration } from '@pinecone-database/pinecone'
|
||||
import { flatten } from 'lodash'
|
||||
import { Pinecone } from '@pinecone-database/pinecone'
|
||||
import { PineconeStoreParams, PineconeStore } from '@langchain/pinecone'
|
||||
import { Embeddings } from '@langchain/core/embeddings'
|
||||
import { Document } from '@langchain/core/documents'
|
||||
@@ -9,23 +9,6 @@ import { FLOWISE_CHATID, getBaseClasses, getCredentialData, getCredentialParam }
|
||||
import { addMMRInputParams, howToUseFileUpload, resolveVectorStoreOrRetriever } from '../VectorStoreUtils'
|
||||
import { index } from '../../../src/indexing'
|
||||
|
||||
let pineconeClientSingleton: Pinecone
|
||||
let pineconeClientOption: PineconeConfiguration
|
||||
|
||||
const getPineconeClient = (option: PineconeConfiguration) => {
|
||||
if (!pineconeClientSingleton) {
|
||||
// if client doesn't exists
|
||||
pineconeClientSingleton = new Pinecone(option)
|
||||
pineconeClientOption = option
|
||||
return pineconeClientSingleton
|
||||
} else if (pineconeClientSingleton && !isEqual(option, pineconeClientOption)) {
|
||||
// if client exists but option changed
|
||||
pineconeClientSingleton = new Pinecone(option)
|
||||
return pineconeClientSingleton
|
||||
}
|
||||
return pineconeClientSingleton
|
||||
}
|
||||
|
||||
class Pinecone_VectorStores implements INode {
|
||||
label: string
|
||||
name: string
|
||||
@@ -155,7 +138,7 @@ class Pinecone_VectorStores implements INode {
|
||||
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
|
||||
const pineconeApiKey = getCredentialParam('pineconeApiKey', credentialData, nodeData)
|
||||
|
||||
const client = getPineconeClient({ apiKey: pineconeApiKey })
|
||||
const client = new Pinecone({ apiKey: pineconeApiKey })
|
||||
|
||||
const pineconeIndex = client.Index(_index)
|
||||
|
||||
@@ -211,7 +194,7 @@ class Pinecone_VectorStores implements INode {
|
||||
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
|
||||
const pineconeApiKey = getCredentialParam('pineconeApiKey', credentialData, nodeData)
|
||||
|
||||
const client = getPineconeClient({ apiKey: pineconeApiKey })
|
||||
const client = new Pinecone({ apiKey: pineconeApiKey })
|
||||
|
||||
const pineconeIndex = client.Index(_index)
|
||||
|
||||
@@ -253,7 +236,7 @@ class Pinecone_VectorStores implements INode {
|
||||
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
|
||||
const pineconeApiKey = getCredentialParam('pineconeApiKey', credentialData, nodeData)
|
||||
|
||||
const client = getPineconeClient({ apiKey: pineconeApiKey })
|
||||
const client = new Pinecone({ apiKey: pineconeApiKey })
|
||||
|
||||
const pineconeIndex = client.Index(index)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user