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

redis[patch]: Add RedisAddOptions to .fromDocuments method in order to perform upsert/update #4351

Conversation

hiitsmax
Copy link
Contributor

@hiitsmax hiitsmax commented Feb 9, 2024

By adding the optional parameter "docsOptions" to the RedisVectorStore.fromDocuments method we are now able to define the index schema directly from there.

This should be useful when performing upserts or updating already existing keys in general.

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Feb 9, 2024
Copy link

vercel bot commented Feb 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 1, 2024 0:40am
langchainjs-docs 🛑 Canceled (Inspect) Mar 1, 2024 0:40am

@dosubot dosubot bot added the auto:improvement Medium size change to existing code to handle new use-cases label Feb 9, 2024
@jacoblee93 jacoblee93 changed the title redis: Add RedisAddOptions to .fromDocuments method in order to perform upsert/update redis[patch]: Add RedisAddOptions to .fromDocuments method in order to perform upsert/update Feb 9, 2024
@jacoblee93
Copy link
Collaborator

Thanks for this! Looks reasonable but the package in langchain-community is deprecated in favor of langchain-redis. Could you move this change there and also add it to fromTexts?

@jacoblee93 jacoblee93 added the question Further information is requested label Feb 9, 2024
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Feb 9, 2024
@hiitsmax
Copy link
Contributor Author

hiitsmax commented Feb 9, 2024

Thanks for the hint!

Now it should be all in the right place ( fromTexts included) (:

Copy link
Member

@bracesproul bracesproul left a comment

Choose a reason for hiding this comment

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

Thanks for adding this! I pushed up a commit removing the updates to the @langchain/community module. Since it's deprecated, we don't want to add more features and instead want to encourage people to update to the @langchain/redis package. Thanks again!

@dosubot dosubot bot added the lgtm PRs that are ready to be merged as-is label Mar 1, 2024
@bracesproul bracesproul removed the question Further information is requested label Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:improvement Medium size change to existing code to handle new use-cases lgtm PRs that are ready to be merged as-is size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants