VectorValue class

Value for storing vector embeddings in models.

モデル内でベクトル埋め込みを保存するための値。

Implemented types
Annotations

Constructors

VectorValue({required List<double> vector, VectorDistanceMeasure measure = VectorDistanceMeasure.cosine})
Value for storing vector embeddings in models.
const
VectorValue.fromList(List<num> list, {VectorDistanceMeasure measure = VectorDistanceMeasure.cosine})
Create a VectorValue from a list of numbers.
factory

Properties

hashCode int
The hash code for this object.
no setteroverride
measure VectorDistanceMeasure
The distance measure.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
vector List<double>
The vector data.
final

Methods

compareTo(VectorValue other) int
Compares this object to another object.
override
cosineSimilarity(VectorValue other) double
Calculate cosine similarity with another vector.
dotProduct(VectorValue other) double
Calculate dot product with another vector.
euclideanDistance(VectorValue other) double
Calculate Euclidean distance with another vector.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
similarity(VectorValue other, {VectorDistanceMeasure measure = VectorDistanceMeasure.cosine}) double
Calculate similarity with another vector using the specified measure.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override