langchain.js
    Preparing search index...

    Class for generating embeddings using the Prem AI's API. Extends the Embeddings class and implements PremEmbeddingsParams and

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    apiKey?: string

    The Prem API key to use for requests.

    process.env.PREM_API_KEY
    
    batchSize: number = 128
    client: Prem
    encoding_format?: "float" | "base64"
    model: string

    The model to generate the embeddings.

    project_id: number

    The ID of the project to use.

    Methods

    • Method to generate embeddings for an array of documents. Splits the documents into batches and makes requests to the Prem API to generate embeddings.

      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.