meta_filter – Filter by any metadata of the document.
not_include_fields – Not pack the specified fields of each document.
limit – The number of documents to return. Defaults to 5. Optional.
Returns
Documents which satisfy the input conditions.
get_current_table(**kwargs: Any) → str[source]¶
Get the current table.
list_tables(**kwargs: Any) → List[str][source]¶
List all the tables created by the client.
load_local(table_name: str, **kwargs: Any) → bool[source]¶
Load the local specified table.
Parameters
table_name – Table name
kwargs – Any possible extend parameters in the future.
Returns
Success or failure of loading the local specified table
max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, text_in_page_content: Optional[str] = None, meta_filter: Optional[dict] = None, **kwargs: Any) → List[Document][source]¶
Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
Parameters
query – Text to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
fetch_k – Number of Documents to fetch to pass to MMR algorithm.
lambda_mult – Number between 0 and 1 that determines the degree
of diversity among the results with 0 corresponding
to maximum diversity and 1 to minimum diversity.
Defaults to 0.5.
text_in_page_content – Filter by the text in page_content of Document.
meta_filter (Optional[dict]) – Filter by metadata. Defaults to None.
Returns
List of Documents selected by maximal marginal relevance.