parent
c99d870c82
commit
601de76aea
|
|
@ -3,7 +3,7 @@ import { Chroma } from '@langchain/community/vectorstores/chroma'
|
|||
import { Embeddings } from '@langchain/core/embeddings'
|
||||
import { Document } from '@langchain/core/documents'
|
||||
import { ICommonObject, INode, INodeData, INodeOutputsValue, INodeParams, IndexingResult } from '../../../src/Interface'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam, parseJsonBody } from '../../../src/utils'
|
||||
import { ChromaExtended } from './core'
|
||||
import { index } from '../../../src/indexing'
|
||||
|
||||
|
|
@ -229,7 +229,7 @@ class Chroma_VectorStores implements INode {
|
|||
if (chromaTenant) obj.chromaTenant = chromaTenant
|
||||
if (chromaDatabase) obj.chromaDatabase = chromaDatabase
|
||||
if (chromaMetadataFilter) {
|
||||
const metadatafilter = typeof chromaMetadataFilter === 'object' ? chromaMetadataFilter : JSON.parse(chromaMetadataFilter)
|
||||
const metadatafilter = typeof chromaMetadataFilter === 'object' ? chromaMetadataFilter : parseJsonBody(chromaMetadataFilter)
|
||||
obj.filter = metadatafilter
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { Document } from '@langchain/core/documents'
|
|||
import { CouchbaseVectorStore, CouchbaseVectorStoreArgs } from '@langchain/community/vectorstores/couchbase'
|
||||
import { Cluster } from 'couchbase'
|
||||
import { ICommonObject, INode, INodeData, INodeOutputsValue, INodeParams, IndexingResult } from '../../../src/Interface'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam, parseJsonBody } from '../../../src/utils'
|
||||
import { resolveVectorStoreOrRetriever } from '../VectorStoreUtils'
|
||||
|
||||
class Couchbase_VectorStores implements INode {
|
||||
|
|
@ -215,7 +215,8 @@ class Couchbase_VectorStores implements INode {
|
|||
if (!embeddingKey || embeddingKey === '') couchbaseConfig.embeddingKey = 'embedding'
|
||||
|
||||
if (couchbaseMetadataFilter) {
|
||||
metadatafilter = typeof couchbaseMetadataFilter === 'object' ? couchbaseMetadataFilter : JSON.parse(couchbaseMetadataFilter)
|
||||
metadatafilter =
|
||||
typeof couchbaseMetadataFilter === 'object' ? couchbaseMetadataFilter : parseJsonBody(couchbaseMetadataFilter)
|
||||
}
|
||||
|
||||
const vectorStore = await CouchbaseVectorStore.initialize(embeddings, couchbaseConfig)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { AmazonKendraRetriever } from '@langchain/aws'
|
|||
import { KendraClient, BatchPutDocumentCommand, BatchDeleteDocumentCommand } from '@aws-sdk/client-kendra'
|
||||
import { Document } from '@langchain/core/documents'
|
||||
import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeOutputsValue, INodeParams, IndexingResult } from '../../../src/Interface'
|
||||
import { FLOWISE_CHATID, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { FLOWISE_CHATID, getCredentialData, getCredentialParam, parseJsonBody } from '../../../src/utils'
|
||||
import { howToUseFileUpload } from '../VectorStoreUtils'
|
||||
import { MODEL_TYPE, getRegions } from '../../../src/modelLoader'
|
||||
|
||||
|
|
@ -248,7 +248,7 @@ class Kendra_VectorStores implements INode {
|
|||
|
||||
let filter = undefined
|
||||
if (attributeFilter) {
|
||||
filter = typeof attributeFilter === 'object' ? attributeFilter : JSON.parse(attributeFilter)
|
||||
filter = typeof attributeFilter === 'object' ? attributeFilter : parseJsonBody(attributeFilter)
|
||||
}
|
||||
|
||||
// Add chat-specific filtering if file upload is enabled
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { flatten } from 'lodash'
|
|||
import { Embeddings } from '@langchain/core/embeddings'
|
||||
import { Document } from '@langchain/core/documents'
|
||||
import { ICommonObject, INode, INodeData, INodeOutputsValue, INodeParams, IndexingResult } from '../../../src/Interface'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam, parseJsonBody } from '../../../src/utils'
|
||||
import { addMMRInputParams, resolveVectorStoreOrRetriever } from '../VectorStoreUtils'
|
||||
import { MongoDBAtlasVectorSearch } from './core'
|
||||
|
||||
|
|
@ -187,7 +187,7 @@ class MongoDBAtlas_VectorStores implements INode {
|
|||
})
|
||||
|
||||
if (mongoMetadataFilter) {
|
||||
const metadataFilter = typeof mongoMetadataFilter === 'object' ? mongoMetadataFilter : JSON.parse(mongoMetadataFilter)
|
||||
const metadataFilter = typeof mongoMetadataFilter === 'object' ? mongoMetadataFilter : parseJsonBody(mongoMetadataFilter)
|
||||
|
||||
for (const key in metadataFilter) {
|
||||
mongoDbFilter.preFilter = {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { Embeddings } from '@langchain/core/embeddings'
|
|||
import { Document } from '@langchain/core/documents'
|
||||
import { VectorStore } from '@langchain/core/vectorstores'
|
||||
import { ICommonObject, INode, INodeData, INodeOutputsValue, INodeParams, IndexingResult } from '../../../src/Interface'
|
||||
import { FLOWISE_CHATID, getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { FLOWISE_CHATID, getBaseClasses, getCredentialData, getCredentialParam, parseJsonBody } from '../../../src/utils'
|
||||
import { addMMRInputParams, howToUseFileUpload, resolveVectorStoreOrRetriever } from '../VectorStoreUtils'
|
||||
import { index } from '../../../src/indexing'
|
||||
|
||||
|
|
@ -248,7 +248,8 @@ class Pinecone_VectorStores implements INode {
|
|||
|
||||
if (pineconeNamespace) obj.namespace = pineconeNamespace
|
||||
if (pineconeMetadataFilter) {
|
||||
const metadatafilter = typeof pineconeMetadataFilter === 'object' ? pineconeMetadataFilter : JSON.parse(pineconeMetadataFilter)
|
||||
const metadatafilter =
|
||||
typeof pineconeMetadataFilter === 'object' ? pineconeMetadataFilter : parseJsonBody(pineconeMetadataFilter)
|
||||
obj.filter = metadatafilter
|
||||
}
|
||||
if (isFileUploadEnabled && options.chatId) {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import { FetchResponse, Index, Pinecone, ScoredPineconeRecord } from '@pinecone-
|
|||
import { flatten } from 'lodash'
|
||||
import { Document as LCDocument } from 'langchain/document'
|
||||
import { ICommonObject, INode, INodeData, INodeOutputsValue, INodeParams, IndexingResult } from '../../../src/Interface'
|
||||
import { flattenObject, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { flattenObject, getCredentialData, getCredentialParam, parseJsonBody } from '../../../src/utils'
|
||||
|
||||
class PineconeLlamaIndex_VectorStores implements INode {
|
||||
label: string
|
||||
|
|
@ -176,7 +176,7 @@ class PineconeLlamaIndex_VectorStores implements INode {
|
|||
|
||||
let metadatafilter = {}
|
||||
if (pineconeMetadataFilter) {
|
||||
metadatafilter = typeof pineconeMetadataFilter === 'object' ? pineconeMetadataFilter : JSON.parse(pineconeMetadataFilter)
|
||||
metadatafilter = typeof pineconeMetadataFilter === 'object' ? pineconeMetadataFilter : parseJsonBody(pineconeMetadataFilter)
|
||||
obj.queryFilter = metadatafilter
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { flatten } from 'lodash'
|
||||
import { Document } from '@langchain/core/documents'
|
||||
import { ICommonObject, INode, INodeData, INodeOutputsValue, INodeParams, IndexingResult } from '../../../src/Interface'
|
||||
import { FLOWISE_CHATID, getBaseClasses } from '../../../src/utils'
|
||||
import { FLOWISE_CHATID, getBaseClasses, parseJsonBody } from '../../../src/utils'
|
||||
import { index } from '../../../src/indexing'
|
||||
import { howToUseFileUpload } from '../VectorStoreUtils'
|
||||
import { VectorStore } from '@langchain/core/vectorstores'
|
||||
|
|
@ -308,7 +308,7 @@ class Postgres_VectorStores implements INode {
|
|||
|
||||
let pgMetadataFilter: any
|
||||
if (_pgMetadataFilter) {
|
||||
pgMetadataFilter = typeof _pgMetadataFilter === 'object' ? _pgMetadataFilter : JSON.parse(_pgMetadataFilter)
|
||||
pgMetadataFilter = typeof _pgMetadataFilter === 'object' ? _pgMetadataFilter : parseJsonBody(_pgMetadataFilter)
|
||||
}
|
||||
if (isFileUploadEnabled && options.chatId) {
|
||||
pgMetadataFilter = {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { Document } from '@langchain/core/documents'
|
|||
import { QdrantVectorStore, QdrantLibArgs } from '@langchain/qdrant'
|
||||
import { Embeddings } from '@langchain/core/embeddings'
|
||||
import { ICommonObject, INode, INodeData, INodeOutputsValue, INodeParams, IndexingResult } from '../../../src/Interface'
|
||||
import { FLOWISE_CHATID, getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { FLOWISE_CHATID, getBaseClasses, getCredentialData, getCredentialParam, parseJsonBody } from '../../../src/utils'
|
||||
import { index } from '../../../src/indexing'
|
||||
import { howToUseFileUpload } from '../VectorStoreUtils'
|
||||
|
||||
|
|
@ -440,7 +440,7 @@ class Qdrant_VectorStores implements INode {
|
|||
qdrantCollectionConfiguration =
|
||||
typeof qdrantCollectionConfiguration === 'object'
|
||||
? qdrantCollectionConfiguration
|
||||
: JSON.parse(qdrantCollectionConfiguration)
|
||||
: parseJsonBody(qdrantCollectionConfiguration)
|
||||
dbConfig.collectionConfig = {
|
||||
...qdrantCollectionConfiguration,
|
||||
vectors: {
|
||||
|
|
@ -452,7 +452,7 @@ class Qdrant_VectorStores implements INode {
|
|||
}
|
||||
|
||||
if (queryFilter) {
|
||||
retrieverConfig.filter = typeof queryFilter === 'object' ? queryFilter : JSON.parse(queryFilter)
|
||||
retrieverConfig.filter = typeof queryFilter === 'object' ? queryFilter : parseJsonBody(queryFilter)
|
||||
}
|
||||
if (isFileUploadEnabled && options.chatId) {
|
||||
retrieverConfig.filter = retrieverConfig.filter || {}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { Document } from '@langchain/core/documents'
|
|||
import { Embeddings } from '@langchain/core/embeddings'
|
||||
import { SupabaseVectorStore, SupabaseLibArgs } from '@langchain/community/vectorstores/supabase'
|
||||
import { ICommonObject, INode, INodeData, INodeOutputsValue, INodeParams, IndexingResult } from '../../../src/Interface'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam, parseJsonBody } from '../../../src/utils'
|
||||
import { addMMRInputParams, resolveVectorStoreOrRetriever } from '../VectorStoreUtils'
|
||||
import { index } from '../../../src/indexing'
|
||||
import { FilterParser } from './filterParser'
|
||||
|
|
@ -230,7 +230,8 @@ class Supabase_VectorStores implements INode {
|
|||
}
|
||||
|
||||
if (supabaseMetadataFilter) {
|
||||
const metadatafilter = typeof supabaseMetadataFilter === 'object' ? supabaseMetadataFilter : JSON.parse(supabaseMetadataFilter)
|
||||
const metadatafilter =
|
||||
typeof supabaseMetadataFilter === 'object' ? supabaseMetadataFilter : parseJsonBody(supabaseMetadataFilter)
|
||||
obj.filter = metadatafilter
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { WeaviateLibArgs, WeaviateStore } from '@langchain/weaviate'
|
|||
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, normalizeKeysRecursively } from '../../../src/utils'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam, normalizeKeysRecursively, parseJsonBody } from '../../../src/utils'
|
||||
import { addMMRInputParams, resolveVectorStoreOrRetriever } from '../VectorStoreUtils'
|
||||
import { index } from '../../../src/indexing'
|
||||
import { VectorStore } from '@langchain/core/vectorstores'
|
||||
|
|
@ -294,7 +294,7 @@ class Weaviate_VectorStores implements INode {
|
|||
if (weaviateTextKey) obj.textKey = weaviateTextKey
|
||||
if (weaviateMetadataKeys) obj.metadataKeys = JSON.parse(weaviateMetadataKeys.replace(/\s/g, ''))
|
||||
if (weaviateFilter) {
|
||||
weaviateFilter = typeof weaviateFilter === 'object' ? weaviateFilter : JSON.parse(weaviateFilter)
|
||||
weaviateFilter = typeof weaviateFilter === 'object' ? weaviateFilter : parseJsonBody(weaviateFilter)
|
||||
}
|
||||
|
||||
const vectorStore = (await WeaviateStore.fromExistingIndex(embeddings, obj)) as unknown as VectorStore
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { ZepVectorStore, IZepConfig } from '@langchain/community/vectorstores/ze
|
|||
import { Embeddings } from '@langchain/core/embeddings'
|
||||
import { Document } from '@langchain/core/documents'
|
||||
import { ICommonObject, INode, INodeData, INodeOutputsValue, INodeParams, IndexingResult } from '../../../src/Interface'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam, parseJsonBody } from '../../../src/utils'
|
||||
import { addMMRInputParams, resolveVectorStoreOrRetriever } from '../VectorStoreUtils'
|
||||
|
||||
class Zep_VectorStores implements INode {
|
||||
|
|
@ -159,7 +159,7 @@ class Zep_VectorStores implements INode {
|
|||
}
|
||||
if (apiKey) zepConfig.apiKey = apiKey
|
||||
if (zepMetadataFilter) {
|
||||
const metadatafilter = typeof zepMetadataFilter === 'object' ? zepMetadataFilter : JSON.parse(zepMetadataFilter)
|
||||
const metadatafilter = typeof zepMetadataFilter === 'object' ? zepMetadataFilter : parseJsonBody(zepMetadataFilter)
|
||||
zepConfig.filter = metadatafilter
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { ZepClient } from '@getzep/zep-cloud'
|
|||
import { IZepConfig, ZepVectorStore } from '@getzep/zep-cloud/langchain'
|
||||
import { Document } from 'langchain/document'
|
||||
import { ICommonObject, INode, INodeData, INodeOutputsValue, INodeParams, IndexingResult } from '../../../src/Interface'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam, parseJsonBody } from '../../../src/utils'
|
||||
import { addMMRInputParams, resolveVectorStoreOrRetriever } from '../VectorStoreUtils'
|
||||
import { FakeEmbeddings } from 'langchain/embeddings/fake'
|
||||
import { Embeddings } from '@langchain/core/embeddings'
|
||||
|
|
@ -129,7 +129,7 @@ class Zep_CloudVectorStores implements INode {
|
|||
collectionName: zepCollection
|
||||
}
|
||||
if (zepMetadataFilter) {
|
||||
zepConfig.filter = typeof zepMetadataFilter === 'object' ? zepMetadataFilter : JSON.parse(zepMetadataFilter)
|
||||
zepConfig.filter = typeof zepMetadataFilter === 'object' ? zepMetadataFilter : parseJsonBody(zepMetadataFilter)
|
||||
}
|
||||
zepConfig.client = new ZepClient({
|
||||
apiKey: apiKey
|
||||
|
|
|
|||
Loading…
Reference in New Issue