Interface EmbeddingsInterface<TOutput>

interface EmbeddingsInterface<TOutput> {
    embedDocuments(documents: string[]): Promise<TOutput[]>;
    embedQuery(document: string): Promise<TOutput>;
}

Type Parameters

  • TOutput = number[]

Implemented by

Methods

  • An abstract method that takes an array of documents as input and returns a promise that resolves to an array of vectors for each document.

    Parameters

    • documents: string[]

      An array of documents to be embedded.

    Returns Promise<TOutput[]>

    A promise that resolves to an array of vectors for each document.

  • An abstract method that takes a single document as input and returns a promise that resolves to a vector for the query document.

    Parameters

    • document: string

      A single document to be embedded.

    Returns Promise<TOutput>

    A promise that resolves to a vector for the query document.