ChromaReader#
- class llama_index.readers.ChromaReader(collection_name: str, persist_directory: Optional[str] = None, chroma_api_impl: str = 'rest', chroma_db_impl: Optional[str] = None, host: str = 'localhost', port: int = 8000)#
Bases:
BaseReader
Chroma reader.
Retrieve documents from existing persisted Chroma collections.
- Parameters
collection_name – Name of the persisted collection.
persist_directory – Directory where the collection is persisted.
Methods Summary
create_documents
(results)Create documents from the results.
load_data
([query_embedding, limit, where, ...])Load data from the collection.
Methods Documentation
- create_documents(results: Any) List[Document] #
Create documents from the results.
- Parameters
results – Results from the query.
- Returns
List of documents.
- load_data(query_embedding: Optional[List[float]] = None, limit: int = 10, where: Optional[dict] = None, where_document: Optional[dict] = None, query: Optional[Union[str, List[str]]] = None) Any #
Load data from the collection.
- Parameters
limit – Number of results to return.
where – Filter results by metadata. {“metadata_field”: “is_equal_to_this”}
where_document – Filter results by document. {“$contains”:”search_string”}
- Returns
List of documents.