Class for generating embeddings using the Tencent Hunyuan API.

Hierarchy

  • TencentHunyuanEmbeddings
    • TencentHunyuanEmbeddings

Constructors

Properties

host: string = "hunyuan.tencentcloudapi.com"
sign: sign
tencentSecretId?: string
tencentSecretKey?: string

Methods

  • Method that takes an array of documents as input and returns a promise that resolves to a 2D array of embeddings for each document. It calls the embedQuery method for each document in the array.

    Parameters

    • documents: string[]

      Array of documents for which to generate embeddings.

    Returns Promise<number[][]>

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

  • Method to generate an embedding for a single document. Calls the embeddingWithRetry 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