Return Marqo initialized from texts. Note that Marqo does not need embeddings, we retain the parameter to adhere to the Liskov substitution principle.
This is a quick way to get started with marqo - simply provide your texts and metadatas and this will create an instance of the data store and index the provided data.
To know the ids of your documents with this approach you will need to include them in under the key "_id" in your metadatas for each text
Example: .. code-block:: python
from langchain_community.vectorstores import Marqo
datastore = Marqo(texts=['text'], index_name='my-first-index',
url='http://localhost:8882')
from_texts(
cls,
texts: List[str],
embedding: Any = None,
metadatas: Optional[List[dict]] = None,
index_name: str = '',
url: str = 'http://localhost:8882',
api_key: str = '',
add_documents_settings: Optional[Dict[str, Any]] = None,
searchable_attributes: Optional[List[str]] = None,
page_content_builder: Optional[Callable[[Dict[str, str]], str]] = None,
index_settings: Optional[Dict[str, Any]] = None,
verbose: bool = True,
**kwargs: Any = {}
) -> Marqo| Name | Type | Description |
|---|---|---|
texts* | List[str] | A list of texts to index into marqo upon creation. |
embedding | Any | Default: NoneEmbeddings (not required). Defaults to None. |
index_name | str | Default: ''The name of the index to use, if none is |
url | str | Default: 'http://localhost:8882'The URL for Marqo. Defaults to "http://localhost:8882". |
api_key | str | Default: ''The API key for Marqo. Defaults to "". |
metadatas | Optional[List[dict]] | Default: NoneA list of metadatas, to |
add_documents_settings | Optional[Dict[str, Any]] | Default: NoneSettings |
https* | unknown | //docs.marqo.ai/0.0.16/API-Reference/documents/#query-parameters. |
index_settings | Optional[Dict[str, Any]] | Default: NoneIndex settings if |
https* | unknown | //docs.marqo.ai/0.0.16/API-Reference/indexes/#index-defaults-object. |