Open
Description
The Document
class contains only final fields (except "embeddings" which is about to be removed). However, the media
(collection) and metadata
(map) are mutable. All vector store implementations, at least, rely on the metadata
field to be mutable because they add new metadata.
#1794 introduced a mutate()
method to build new instances of Document
objects. This issue is to discuss whether Document
should be immutable. If yes, we need to to refactor all vector store implementations to work accordingly. Also, it's a breaking change, so it should be documented and communicated in the release notes.