Skip to main content

Text Functions

The vector function package contains functions for creating and comparing vectors.

IMPORT vector.*; -- imports all functions
IMPORT vector.toJson; -- imports single function

Reference

The following table lists all the functions in the vector package with a short description.

Function NameDescription
centerAggregates vectors by computing the centroid, i.e. summing up all vectors and dividing the resulting vector by the number of vectors.
cosineDistanceComputes the cosine distance between two vectors
cosineSimilarityComputes the cosine similarity between two vectors
euclideanDistanceComputes the euclidean distance between two vectors
onnxEmbedComputes a vector embedding for the given string based on the provided ONNX vector embedding model. The embedding model should be stored in a directory that is accessible at runtime.
vectorToDoubleConverts a vector to a double array