Bugfix/Json parse metadata filter (#5392)

json parse metadata filter
This commit is contained in:
Henry Heng
2025-10-30 13:04:29 +00:00
committed by GitHub
parent c99d870c82
commit 601de76aea
12 changed files with 28 additions and 25 deletions
@@ -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