aiq.retriever.milvus.retriever#
Attributes#
Exceptions#
Common base class for all non-exit exceptions. |
Classes#
Client for retrieving document chunks from a Milvus vectorstore |
Functions#
|
|
Module Contents#
- logger#
- exception CollectionNotFoundError#
Bases:
aiq.retriever.models.RetrieverError
Common base class for all non-exit exceptions.
Initialize self. See help(type(self)) for accurate signature.
- class MilvusRetriever(
- client: pymilvus.MilvusClient,
- embedder: langchain_core.embeddings.Embeddings,
- content_field: str = 'text',
- use_iterator: bool = False,
Bases:
aiq.retriever.interface.AIQRetriever
Client for retrieving document chunks from a Milvus vectorstore
Initialize the Milvus Retriever using a preconfigured MilvusClient
- Args:
client (MilvusClient): Preinstantiate pymilvus.MilvusClient object.
- _client#
- _embedder#
- _search_func#
- _default_params = None#
- _bound_params = []#
- content_field = 'text'#
- bind(**kwargs) None #
Bind default values to the search method. Cannot bind the ‘query’ parameter.
- Args:
kwargs (dict): Key value pairs corresponding to the default values of search parameters.
- get_unbound_params() list[str] #
Returns a list of unbound parameters which will need to be passed to the search function.
- async search(query: str, **kwargs)#
Retireve max(top_k) items from the data store based on vector similarity search (implementation dependent).
- async _search_with_iterator(
- query: str,
- *,
- collection_name: str,
- top_k: int,
- filters: str | None = None,
- output_fields: list[str] | None = None,
- search_params: dict | None = None,
- timeout: float | None = None,
- vector_field_name: str | None = 'vector',
- distance_cutoff: float | None = None,
- **kwargs,
Retrieve document chunks from a Milvus vectorstore using a search iterator, allowing for the retrieval of more results.
- async _search(
- query: str,
- *,
- collection_name: str,
- top_k: int,
- filters: str | None = None,
- output_fields: list[str] | None = None,
- search_params: dict | None = None,
- timeout: float | None = None,
- vector_field_name: str | None = 'vector',
- **kwargs,
Retrieve document chunks from a Milvus vectorstore
- _wrap_milvus_single_results( ) aiq.retriever.models.AIQDocument #