tmc / langchaingo

LangChain for Go, the easiest way to write LLM-based programs in Go
https://tmc.github.io/langchaingo/
MIT License
5k stars 643 forks source link

vectorstores: add `Replacement` option #1062

Open creeper12356 opened 2 weeks ago

creeper12356 commented 2 weeks ago

vectorstores: add Replacement option

This PR 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 replace). When Replacement is set to false (default case) , AddDocuments function will simply add documents without checking existing document records.

PR Checklist