-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Chroma_Existing.ts to add metadatafilter #880
Conversation
Hi @pooriaarab, Thanks for the PR for adding missing metadata filter in |
@@ -86,13 +93,18 @@ class Chroma_Existing_VectorStores implements INode { | |||
const credentialData = await getCredentialData(nodeData.credential ?? '', options) | |||
const chromaApiKey = getCredentialParam('chromaApiKey', credentialData, nodeData) | |||
|
|||
const chromaMetadataFilter = nodeData.inputs?.chromaMetadataFilter; | |||
const metadataFilter = chromaMetadataFilter ? JSON.parse(chromaMetadataFilter) : {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommend following other Metadata Filter
standard
Examples:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chungyau97 thx for reviewing it.
I compared it to the pinecone_existing.ts and it look exactly to how I implemented chroma_existing.ts. Even the lines you highlighted above, I checked them and I couldn't find the difference.
P.S. This is my second time using TS and my first PR for an open-source repo 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @pooriaarab, sorry for the confusing lines shown above.
No worries, I will guide you.
Line: 103
Should be filter?: object | undefined
instead of metadataFilter?: any
Lines: 97 & 107 should be combined and follow below format
if (chromaMetadataFilter) {
const metadatafilter = typeof chromaMetadataFilter === 'object' ? chromaMetadataFilter : JSON.parse(chromaMetadataFilter)
obj.filter = metadatafilter
}
Lastly, remember to run yarn lint-fix
and share your results after implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx for the tips Yau!!!
Worked like a charm. Learned about git clone, add...
Only trouble I had was I cloned the main flowise repo but when I tried pushing it to the repo using "git push origin main" i got an error (i think it's because I don't have push access)
So I just ended up copy pasting it visually on the github website.
How can I push changes from my CLI?
add accidentally removed chromaApiKey
remove not needed code
thanks @pooriaarab ! |
Update Chroma_Existing.ts to add metadatafilter
No description provided.