mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 15:00:57 +03:00
Revert "Feature/Add faiss"
This commit is contained in:
@@ -14,7 +14,7 @@ import {
|
||||
INodeData,
|
||||
IOverrideConfig
|
||||
} from '../Interface'
|
||||
import { cloneDeep, get, omit, merge } from 'lodash'
|
||||
import { cloneDeep, get } from 'lodash'
|
||||
import { ICommonObject, getInputVariables } from 'flowise-components'
|
||||
import { scryptSync, randomBytes, timingSafeEqual } from 'crypto'
|
||||
|
||||
@@ -317,25 +317,6 @@ export const getVariableValue = (paramValue: string, reactFlowNodes: IReactFlowN
|
||||
return returnVal
|
||||
}
|
||||
|
||||
/**
|
||||
* Temporarily disable streaming if vectorStore is Faiss
|
||||
* @param {INodeData} flowNodeData
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export const isVectorStoreFaiss = (flowNodeData: INodeData) => {
|
||||
if (flowNodeData.inputs && flowNodeData.inputs.vectorStoreRetriever) {
|
||||
const vectorStoreRetriever = flowNodeData.inputs.vectorStoreRetriever
|
||||
if (typeof vectorStoreRetriever === 'string' && vectorStoreRetriever.includes('faiss')) return true
|
||||
if (
|
||||
typeof vectorStoreRetriever === 'object' &&
|
||||
vectorStoreRetriever.vectorStore &&
|
||||
vectorStoreRetriever.vectorStore.constructor.name === 'FaissStore'
|
||||
)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* Loop through each inputs and resolve variable if neccessary
|
||||
* @param {INodeData} reactFlowNodeData
|
||||
@@ -344,12 +325,7 @@ export const isVectorStoreFaiss = (flowNodeData: INodeData) => {
|
||||
* @returns {INodeData}
|
||||
*/
|
||||
export const resolveVariables = (reactFlowNodeData: INodeData, reactFlowNodes: IReactFlowNode[], question: string): INodeData => {
|
||||
let flowNodeData = cloneDeep(reactFlowNodeData)
|
||||
if (reactFlowNodeData.instance && isVectorStoreFaiss(reactFlowNodeData)) {
|
||||
// omit and merge because cloneDeep of instance gives "Illegal invocation" Exception
|
||||
const flowNodeDataWithoutInstance = cloneDeep(omit(reactFlowNodeData, ['instance']))
|
||||
flowNodeData = merge(flowNodeDataWithoutInstance, { instance: reactFlowNodeData.instance })
|
||||
}
|
||||
const flowNodeData = cloneDeep(reactFlowNodeData)
|
||||
const types = 'inputs'
|
||||
|
||||
const getParamValues = (paramsObj: ICommonObject) => {
|
||||
@@ -657,5 +633,5 @@ export const isFlowValidForStream = (reactFlowNodes: IReactFlowNode[], endingNod
|
||||
}
|
||||
}
|
||||
|
||||
return isChatOrLLMsExist && endingNodeData.category === 'Chains' && !isVectorStoreFaiss(endingNodeData)
|
||||
return isChatOrLLMsExist && endingNodeData.category === 'Chains'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user