Construct USearch wrapper from raw documents. This is a user friendly interface that: 1. Embeds documents. 2. Creates an in memory docstore 3. Initializes the USearch database This is intended to be a quick way to get started.
from_texts(
cls,
texts: List[str],
embedding: Embeddings,
metadatas: Optional[List[Dict]] = None,
ids: Optional[Union[np.ndarray, list[str]]] = None,
metric: str = 'cos',
**kwargs: Any = {}
) -> USearchExample:
.. code-block:: python
from langchain_community.vectorstores import USearch from langchain_community.embeddings import OpenAIEmbeddings
embeddings = OpenAIEmbeddings() usearch = USearch.from_texts(texts, embeddings)