search_kwargs={'filter': {'paper_title':'GPT-4 Technical Report'}}
)
async asearch(query: str, search_type: str, **kwargs: Any) → List[Document]¶
Return docs most similar to query using specified search type.
async asimilarity_search(query: str, k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to query.
async asimilarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to embedding vector.
async asimilarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶
Return docs most similar to query.
static delete(ids: Optional[List[str]] = None, **kwargs: Any) → bool[source]¶
Delete a Redis entry.
Parameters
ids – List of ids (keys in redis) to delete.
redis_url – Redis connection url. This should be passed in the kwargs
or set as an environment variable: REDIS_URL.
Returns
Whether or not the deletions were successful.
Return type
bool
Raises
ValueError – If the redis python package is not installed.
ValueError – If the ids (keys in redis) are not provided
static drop_index(index_name: str, delete_documents: bool, **kwargs: Any) → bool[source]¶
Drop a Redis search index.
Parameters
index_name (str) – Name of the index to drop.
delete_documents (bool) – Whether to drop the associated documents.
Returns
Whether or not the drop was successful.
Return type
bool
classmethod from_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶