Interface for the arguments that can be passed to the FakeVectorStore constructor. It includes an optional similarity function.

interface FakeVectorStoreArgs {
    similarity?: ((a: number[], b: number[]) => number);
}

Properties

Properties

similarity?: ((a: number[], b: number[]) => number)

Type declaration

    • (a, b): number
    • Returns the average of cosine distances between vectors a and b

      Parameters

      • a: number[]

        first vector

      • b: number[]

        second vector

      Returns number