chroma.vectorstores¶
A module for calling Chroma's Client and Collection.
BaseVectorStore
¶
Bases: BaseModel
, Generic[BaseQueryResultsT]
, ABC
The base class abstract interface for interacting with vectorstores.
Source code in mirascope/rag/vectorstores.py
add(text, **kwargs)
abstractmethod
¶
ChromaSettings
¶
Bases: BaseModel
Source code in mirascope/chroma/types.py
kwargs()
¶
Returns all parameters for the index as a keyword arguments dictionary.
Source code in mirascope/chroma/types.py
ChromaVectorStore
¶
Bases: BaseVectorStore
A vectorstore for Chroma.
Example:
from mirascope.chroma import ChromaSettings, ChromaVectorStore
from mirascope.openai import OpenAIEmbedder
from mirascope.rag import TextChunker
class MyStore(ChromaVectorStore):
embedder = OpenAIEmbedder()
chunker = TextChunker(chunk_size=1000, chunk_overlap=200)
index_name = "my-store-0001"
client_settings = ChromaSettings()
my_store = MyStore()
with open(f"{PATH_TO_FILE}") as file:
data = file.read()
my_store.add(data)
documents = my_store.retrieve("my question").documents
print(documents)
Source code in mirascope/chroma/vectorstores.py
add(text, **kwargs)
¶
Takes unstructured data and upserts into vectorstore
Source code in mirascope/chroma/vectorstores.py
retrieve(text=None, **kwargs)
¶
Queries the vectorstore for closest match