Embedding

Properties

topK

number

topP

number

temperature

number

repeatPenality

number

flashAttention

boolean

contextSize

number


Methods

get

(input, options) => number[]

Creates a new vector from the provided input

Returns the vector from the language model

calculateCosineSimilarity

(vectorA, vectorB) => number

Calculates the cosine similarity between two embeddings. Only compare embeddings created by the same model

Returns a value between 0 and 1 representing the similarity. 1 being the most similar

findSimilar

(embeddings, target) => any[]

Finds and sorts similar vectors

Returns a list of ids, sorted by the most similar to the least similar

Last updated