Class BaseGoogleEmbeddings<AuthOptions>Abstract

Enables calls to Google APIs for generating text embeddings.

Type Parameters

  • AuthOptions

Hierarchy (view full)

Implements

Constructors

Properties

model: string

Methods

  • Takes an array of documents as input and returns a promise that resolves to a 2D array of embeddings for each document. It splits the documents into chunks and makes requests to the Google Vertex AI API to generate embeddings.

    Parameters

    • documents: string[]

      An array of documents to be embedded.

    Returns Promise<number[][]>

    A promise that resolves to a 2D array of embeddings for each document.

  • Takes a document as input and returns a promise that resolves to an embedding for the document. It calls the embedDocuments method with the document as the input.

    Parameters

    • document: string

      A document to be embedded.

    Returns Promise<number[]>

    A promise that resolves to an embedding for the document.