instrukt.indexes.manager
.IndexManager
- class instrukt.indexes.manager.IndexManager(*, chroma_settings: ChromaSettings, chroma_kwargs: dict[str, Any] = None, **kwargs)[source]
Bases:
BaseModel
Helper to access chroma indexes.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- param chroma_kwargs: dict[str, Any] [Optional]
- param chroma_settings: ChromaSettings [Required]
- async aget_index(collection_name: str) ChromaWrapper | None [source]
Async version of get_index.
- create(_ctx: Context, index: Index) ChromaWrapper | None [source]
Create a new index from the given file or directory path.
- get_embedding_fn(col_name: str) EmbeddingDetails [source]
Get embedding function as fully qualified class name for the collection.
The embedding function is stored in the collection metadata.
- Returns:
(embedding_fn_cls, Optional[model_name])
- get_embedding_fn_cls(embedding_fqn: str) Type[TEmbeddings] [source]
Get embedding function class for the collection.
- get_index(collection_name: str) ChromaWrapper | None [source]
Return the chroma db instance for the given collection name.
- list_collections() Sequence[Collection] [source]
List the available index collections.
- property indexes: Sequence[str]
Return the list of loaded indexes.