#2595 ChromaDB: Add ability to adjust metadata for indexes upon creating co… (#2597)

Referencing #2595
Added optional default parameter to adjust index metadata upon
collection creation per chroma code

ce0bc89777/chromadb/api/local.py (L74)

Allowing for user to have the ability to adjust distance calculation
functions.
This commit is contained in:
rkeshwani 2023-04-08 15:31:17 -05:00 committed by GitHub
parent b9e5b27a99
commit 5e57496225
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,6 +59,7 @@ class Chroma(VectorStore):
embedding_function: Optional[Embeddings] = None, embedding_function: Optional[Embeddings] = None,
persist_directory: Optional[str] = None, persist_directory: Optional[str] = None,
client_settings: Optional[chromadb.config.Settings] = None, client_settings: Optional[chromadb.config.Settings] = None,
collection_metadata: Optional[Dict] = None,
) -> None: ) -> None:
"""Initialize with Chroma client.""" """Initialize with Chroma client."""
try: try:
@ -86,6 +87,7 @@ class Chroma(VectorStore):
embedding_function=self._embedding_function.embed_documents embedding_function=self._embedding_function.embed_documents
if self._embedding_function is not None if self._embedding_function is not None
else None, else None,
metadata=collection_metadata,
) )
def add_texts( def add_texts(