Class for generating embeddings for text and images using Google's Vertex AI. It extends the Embeddings base class and implements the GoogleVertexAIMultimodalEmbeddingsParams interface.

Hierarchy

Implements

Constructors

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.

model: string = "multimodalembedding@001"

Model to use

Methods

  • Generates embeddings for multiple text documents.

    Parameters

    • documents: string[]

      An array of text documents.

    Returns Promise<number[][]>

    A promise that resolves to an array of text document embeddings.

  • Generates embeddings for multiple images.

    Parameters

    • images: Buffer[]

      An array of images.

    Returns Promise<number[][]>

    A promise that resolves to an array of image embeddings.

  • Generates embeddings for a single image.

    Parameters

    • image: Buffer

      A single image.

    Returns Promise<number[]>

    A promise that resolves to an image embedding.

  • Generates embeddings for multiple media instances.

    Parameters

    Returns Promise<MediaEmbeddings[]>

    A promise that resolves to an array of media embeddings.

  • Generates embeddings for a single media instance.

    Parameters

    Returns Promise<MediaEmbeddings>

    A promise that resolves to a media embedding.

  • Generates embeddings for a single text document.

    Parameters

    • document: string

      A single text document.

    Returns Promise<number[]>

    A promise that resolves to a text document embedding.

  • Converts media (text or image) to an instance that can be used for generating embeddings.

    Parameters

    Returns GoogleVertexAIMultimodalEmbeddingsInstance

    An instance of media that can be used for generating embeddings.

  • Converts the response from Google Vertex AI to embeddings.

    Parameters

    • response: GoogleVertexAILLMResponse<GoogleVertexAIMultimodalEmbeddingsResults>

      The response from Google Vertex AI.

    Returns MediaEmbeddings[]

    An array of media embeddings.

Generated using TypeDoc