-
-
Notifications
You must be signed in to change notification settings - Fork 728
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
vectorstores: add Replacement
option
#1062
base: main
Are you sure you want to change the base?
Conversation
The changes introduce a `Replacement` member to the vectorstores options. This option can be used in `AddDocuments` function. When Replacement is set to `true`, AddDocuments function will delete old record with the same Metadata attribute. (i.e to cover or to replace). When Replacement is set to `false`(default case), AddDocuments function will simply add documents without checking existing document records.
- add doc for `WithReplacement` opt - add test in pgvector_test
// when adding documents. If set to true, the existing document with the **Metadata** will | ||
// be replaced with the new document. If set to false(default case), the new document will | ||
// be added to the store and the existing document will be kept. | ||
func WithReplacement(replacement bool) Option { |
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.
I see this only implemented in pgvector
. I would love to see all other stores implement this option, or atleast initially return a not implemented
error.
@creeper12356 can you refresh this and as mentioned above have some non-implementation case for other stores would be nice. |
@tmc I will try to refresh this in one month. Thanks for noticing. 😄 |
vectorstores: add
Replacement
optionThis PR introduce a
Replacement
member to the vectorstores options. This option can be used inAddDocuments
function.When Replacement is set to
true
, AddDocuments function will delete old record with the same Metadata attribute. (i.e to replace).When Replacement is set to
false
(default case) , AddDocumentsfunction will simply add documents without checking existing
document records.
PR Checklist
memory: add interfaces for X, Y
orutil: add whizzbang helpers
).Fixes #123
).golangci-lint
checks.