Interface extending EmbeddingsParams with additional parameters specific to the MixedbreadAIEmbeddings class.

interface MixedbreadAIEmbeddingsParams {
    apiKey?: string;
    baseUrl?: string;
    batchSize?: number;
    dimensions?: number;
    encodingFormat?: EmbeddingsRequestEncodingFormat;
    maxConcurrency?: number;
    maxRetries?: number;
    model?: string;
    normalized?: boolean;
    onFailedAttempt?: FailedAttemptHandler;
    prompt?: string;
    truncationStrategy?: TruncationStrategy;
}

Hierarchy

  • EmbeddingsParams
  • Omit<EmbeddingsRequestWithoutInput, "model">
    • MixedbreadAIEmbeddingsParams

Properties

apiKey?: string

The API key to use.

{process.env.MXBAI_API_KEY}
baseUrl?: string

The base URL for the API.

batchSize?: number

The maximum number of documents to embed in a single request.

{128}
dimensions?: number

The number of dimensions to use for the embeddings.

encodingFormat?: EmbeddingsRequestEncodingFormat
maxConcurrency?: number

The maximum number of concurrent calls that can be made. Defaults to Infinity, which means no limit.

maxRetries?: number

The maximum number of retries that can be made for a single call, with an exponential backoff between each attempt. Defaults to 6.

model?: string

The model to use for generating embeddings.

{"mixedbread-ai/mxbai-embed-large-v1"}
normalized?: boolean

Whether to normalize the embeddings.

onFailedAttempt?: FailedAttemptHandler

Custom handler to handle failed attempts. Takes the originally thrown error object as input, and should itself throw an error if the input error is not retryable.

prompt?: string

The prompt to use for the embedding creation.

truncationStrategy?: TruncationStrategy

The truncation strategy to use for the input.