org.llm4s.vectorstore.redis.RedisDistanceMetric
See theRedisDistanceMetric companion object
The distance a Redis VECTOR field is indexed with, fixed when the index is created.
Redis reports a distance (lower is closer); RedisVectorStore turns it into a org.llm4s.vectorstore.ScoredRecord score in [0, 1], higher meaning closer: 1 - distance / 2 for RedisDistanceMetric.Cosine (the cosine distance lies in [0, 2], so this is (1 + cosine) / 2) and for RedisDistanceMetric.InnerProduct ((1 + dot) / 2, in [0, 1] for unit-length vectors), and 1 / (1 + distance) for RedisDistanceMetric.L2. Scores are clamped to [0, 1].
Value parameters
- wireName
-
the value of the field's
DISTANCE_METRICattribute
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any
Members list
In this article