A class that provides fake embeddings by overriding the embedDocuments and embedQuery methods to return fixed values.

Hierarchy

  • Embeddings
    • FakeEmbeddings

Constructors

Properties

Methods

Constructors

  • Parameters

    • Optionalparams: AsyncCallerParams

    Returns FakeEmbeddings

Properties

caller: AsyncCaller

The async caller should be used by subclasses to make any async calls, which will thus benefit from the concurrency and retry logic.

Methods

  • Generates fixed embeddings for a list of documents.

    Parameters

    • documents: string[]

      List of documents to generate embeddings for.

    Returns Promise<number[][]>

    A promise that resolves with a list of fixed embeddings for each document.

  • Generates a fixed embedding for a query.

    Parameters

    • _: string

      The query to generate an embedding for.

    Returns Promise<number[]>

    A promise that resolves with a fixed embedding for the query.