ChromadbStore#
Info
To see example of using ChromadbStore visit: How-To: Use Chromadb to Store Similarity Index
dbally.similarity.ChromadbStore
#
ChromadbStore(index_name: str, chroma_client: ClientAPI, embedding_function: Union[EmbeddingClient, EmbeddingFunction], max_distance: Optional[float] = None, distance_method: Literal['l2', 'ip', 'cosine'] = 'l2')
Bases: SimilarityStore
Class that stores text embeddings using Chroma
Source code in src/dbally/similarity/chroma_store.py
store
async
#
Fills chroma collection with embeddings of provided string. As the id uses hash value of the string.
PARAMETER | DESCRIPTION |
---|---|
data |
The data to store.
TYPE:
|
Source code in src/dbally/similarity/chroma_store.py
find_similar
async
#
Finds the most similar text in the chroma collection or returns None if the most similar text
has distance bigger than self.max_distance
.
PARAMETER | DESCRIPTION |
---|---|
text |
The text to find similar to.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Optional[str]
|
The most similar text or None if no similar text is found. |