First upload version 0.0.1

This commit is contained in:
Neyra
2026-02-05 15:27:49 +08:00
commit 8e9b7201ed
4182 changed files with 593136 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
export type LlamaEmbeddingOptions = {
vector: readonly number[];
};
export type LlamaEmbeddingJSON = {
type: "embedding";
vector: readonly number[];
};
export declare class LlamaEmbedding {
readonly vector: readonly number[];
constructor(options: LlamaEmbeddingOptions);
toJSON(): LlamaEmbeddingJSON;
/**
* Calculates the cosine similarity between this embedding and another embedding.
*
* Note that you should only compare embeddings created by the exact same model file.
* @returns A value between 0 and 1 representing the similarity between the embedding vectors,
* where 1 means the embeddings are identical.
*/
calculateCosineSimilarity(other: LlamaEmbedding | LlamaEmbeddingJSON | readonly number[]): number;
static fromJSON(json: LlamaEmbeddingJSON): LlamaEmbedding;
}