utilities#

Classes

utilities.redis.TokenEscaper([escape_chars_re])

Escape punctuation within an input string.

utilities.utils.DistanceStrategy(value[, ...])

Enumerator of the Distance strategies for calculating distances between vectors.

Functions

utilities.math.cosine_similarity(X, Y)

Row-wise cosine similarity between two equal-width matrices.

utilities.math.cosine_similarity_top_k(X, Y)

Row-wise cosine similarity with optional top-k and score threshold filtering.

utilities.redis.get_client(redis_url, **kwargs)

Get a redis client from the connection url given.

utilities.utils.filter_complex_metadata(...)

Filter out metadata types that are not supported for a vector store.

utilities.utils.maximal_marginal_relevance(...)

Calculate maximal marginal relevance.