Skip to content

Commit

Permalink
Typefix for findSimilar
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas101 committed Nov 11, 2024
1 parent ba51f48 commit 30f7266
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function calculateCosineSimilarity (vectorA: AIEmbeddingVector, vectorB:
* @param target: the target vector to compare against
* @returns a list of embedding ids sorted by similarity
*/
export function findSimilar (embeddings: AIEmbeddingVectorListItem, target: AIEmbeddingVector): AIEmbeddingVectorListItem[] {
export function findSimilar (embeddings: AIEmbeddingVectorListItem, target: AIEmbeddingVector): any[] {
const similarities = new Map<any, number>()
for (const { id, vector } of embeddings) {
similarities.set(id, calculateCosineSimilarity(vector, target))
Expand Down

0 comments on commit 30f7266

Please sign in to comment.