langchain.js
    Preparing search index...

    A class for generating embeddings using the Fireworks AI API.

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    • Constructor for the FireworksEmbeddings class.

      Parameters

      • Optionalfields: Partial<FireworksEmbeddingsParams> & { apiKey?: string; verbose?: boolean }

        An optional object with properties to configure the instance.

      Returns FireworksEmbeddings

    Properties

    apiUrl: string
    basePath?: string = "https://api.fireworks.ai/inference/v1"
    batchSize: number = 8

    The maximum number of documents to embed in a single request. This is limited by the Fireworks AI API to a maximum of 8.

    headers?: Record<string, string>
    model: string = "nomic-ai/nomic-embed-text-v1.5"

    Model name to use.

    modelName: string = "nomic-ai/nomic-embed-text-v1.5"

    Use model instead.

    Methods

    • Generates embeddings for an array of texts.

      Parameters

      • texts: string[]

        An array of strings to generate embeddings for.

      Returns Promise<number[][]>

      A Promise that resolves to an array of embeddings.

    • Generates an embedding for a single text.

      Parameters

      • text: string

        A string to generate an embedding for.

      Returns Promise<number[]>

      A Promise that resolves to an array of numbers representing the embedding.