feat(chroma): Add support for collection forking (#32627)

This commit is contained in:
itaismith
2025-08-21 14:57:55 -07:00
committed by GitHub
parent 8545d4731e
commit 1eb45d17fb
2 changed files with 53 additions and 3 deletions

View File

@@ -485,6 +485,23 @@ class Chroma(VectorStore):
with open(uri, "rb") as image_file:
return base64.b64encode(image_file.read()).decode("utf-8")
def fork(self, new_name: str) -> Chroma:
"""Fork this vector store.
Args:
new_name: New name for the forked store.
Returns:
A new Chroma store forked from this vector store.
"""
forked_collection = self._collection.fork(new_name=new_name)
return Chroma(
client=self._client,
embedding_function=self._embedding_function,
collection_name=forked_collection.name,
)
def add_images(
self,
uris: list[str],