Class for generating embeddings using the YandexGPT Foundation models API. Extends the Embeddings class and implements YandexGPTEmbeddings

Hierarchy (view full)

Implements

Constructors

Properties

model: string = "text-search-query"

Model name to use.

modelVersion: string = "latest"

Model version to use.

apiKey?: string

Yandex Cloud Api Key for service account with the ai.languageModels.user role.

folderID?: string

Yandex Cloud Folder ID.

iamToken?: string

Yandex Cloud IAM token for service or user account with the ai.languageModels.user role.

modelURI?: string

Model URI to use.

Methods

  • Method to generate embeddings for an array of documents.

    Parameters

    • texts: string[]

      Array of documents to generate embeddings for.

    Returns Promise<number[][]>

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

  • Method to generate an embedding for a single document. Calls the embedDocuments method with the document as the input.

    Parameters

    • text: string

      Document to generate an embedding for.

    Returns Promise<number[]>

    Promise that resolves to an embedding for the document.

Generated using TypeDoc