metadatas – List of metadata dictionaries to associate with documents.
metric – Optional, Metric to use for indexing. Defaults to “euclidean”.
index_type – Optional, Vector index type (“FLAT”, IVF_FLAT”)
config – Optional, TileDB config
index_timestamp – Optional, timestamp to write new texts with.
Example
from langchain_community import TileDB
from langchain_community.embeddings import OpenAIEmbeddings
embeddings = OpenAIEmbeddings()
text_embeddings = embeddings.embed_documents(texts)
text_embedding_pairs = list(zip(texts, text_embeddings))
db = TileDB.from_embeddings(text_embedding_pairs, embeddings)
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, ids: Optional[List[str]] = None, metric: str = 'euclidean', index_uri: str = '/tmp/tiledb_array', index_type: str = 'FLAT', config: Optional[Mapping[str, Any]] = None, index_timestamp: int = 0, **kwargs: Any) → TileDB[source]¶
Construct a TileDB index from raw documents.
Parameters
texts – List of documents to index.
embedding – Embedding function to use.
metadatas – List of metadata dictionaries to associate with documents.
ids – Optional ids of each text object.
metric – Metric to use for indexing. Defaults to “euclidean”.
index_uri – The URI to write the TileDB arrays
index_type – Optional,  Vector index type (“FLAT”, IVF_FLAT”)
config – Optional, TileDB config
index_timestamp – Optional, timestamp to write new texts with.
Example
from langchain_community import TileDB
from langchain_community.embeddings import OpenAIEmbeddings
embeddings = OpenAIEmbeddings()
index = TileDB.from_texts(texts, embeddings)