Create an index from a list of contexts.
It modifies the index argument in-place!
create_index(
contexts: List[str],
index: Any,
embeddings: Embeddings,
sparse_encoder: Any,
ids: Optional[List[str]] = None,
metadatas: Optional[List[dict]] = None,
namespace: Optional[str] = None,
text_key: str = 'context'
) -> None| Name | Type | Description |
|---|---|---|
contexts* | List[str] | List of contexts to embed. |
index* | Any | Index to use. |
embeddings* | Embeddings | Embeddings model to use. |
sparse_encoder* | Any | Sparse encoder to use. |
ids | Optional[List[str]] | Default: NoneList of ids to use for the documents. |
metadatas | Optional[List[dict]] | Default: NoneList of metadata to use for the documents. |
namespace | Optional[str] | Default: NoneNamespace value for index partition. |