Skip to content
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

Merged
merged 4 commits into from
Sep 8, 2023

Conversation

pooriaarab
Copy link
Contributor

No description provided.

@chungyau97
Copy link
Contributor

Hi @pooriaarab,

Thanks for the PR for adding missing metadata filter in Chroma Existing. Appreciate it a lot.
Could you share some results [screenshots/short video]?

@@ -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) : {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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 🙂

Copy link
Contributor

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
image

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.

Copy link
Contributor Author

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
@HenryHengZJ
Copy link
Contributor

thanks @pooriaarab !

@HenryHengZJ HenryHengZJ merged commit fcae6f0 into FlowiseAI:main Sep 8, 2023
hemati pushed a commit to hemati/Flowise that referenced this pull request Dec 27, 2023
Update Chroma_Existing.ts to add metadatafilter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants