Hierarchy

  • Embeddings
    • WatsonxEmbeddings

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.

maxConcurrency?: number
maxRetries?: number
model: string
projectId?: string
serviceUrl: string
spaceId?: string
truncateInputTokens?: number
version: string

Methods

  • An abstract method that takes an array of documents as input and returns a promise that resolves to an array of vectors for each document.

    Parameters

    • documents: string[]

      An array of documents to be embedded.

    Returns Promise<number[][]>

    A promise that resolves to an array of vectors for each document.

  • An abstract method that takes a single document as input and returns a promise that resolves to a vector for the query document.

    Parameters

    • document: string

      A single document to be embedded.

    Returns Promise<number[]>

    A promise that resolves to a vector for the query document.

  • Returns {
        modelId: string;
        projectId: string;
        spaceId?: undefined;
    } | {
        modelId: string;
        projectId?: undefined;
        spaceId: undefined | string;
    }