from_llm(
cls,
llm: BaseLanguageModel,
vectorstore: VectorStore,
document_contents: str,
metadata_field_info| Name | Type | Description |
|---|---|---|
llm* | BaseLanguageModel | A Reasoning model that will produce the structured query. |
vectorstore* | VectorStore | MongoDBAtlasVectorSearch. |
document_contents* | str | Description of the data in the collection. |
metadata_field_info* | Sequence[Union[AttributeInfo, dict]] | |
enable_limit | bool | Default: False |
use_original_query | bool | Default: False |
**kwargs | Any | Default: {} |
Create a self-querying retriever from an LLM, vector store, and document metadata.
This method does NOT create the vector search index. See example usage.
Returns: A retriever invoked by a text query.
Fields must be present in vector search index.
Whether to instruct the LLM to look for statements involving limits.
By default, sentences defining filters and limits are removed from query. Set to True if you wish to include these in the text to embed.
Additional arguments to pass to retriever constructor (e.g. search_kwargs)