Interface for MinimaxEmbeddings parameters. Extends EmbeddingsParams and defines additional parameters specific to the MinimaxEmbeddings class.

interface MinimaxEmbeddingsParams {
    apiKey?: string;
    batchSize?: number;
    maxConcurrency?: number;
    maxRetries?: number;
    minimaxApiKey?: string;
    minimaxGroupId?: string;
    model: string;
    modelName: string;
    onFailedAttempt?: FailedAttemptHandler;
    stripNewLines?: boolean;
    type?: "query" | "db";
}

Hierarchy

  • EmbeddingsParams
    • MinimaxEmbeddingsParams

Implemented by

Properties

apiKey?: string

Secret key to use when making requests. Defaults to the value of MINIMAX_API_KEY environment variable.

batchSize?: number

The maximum number of documents to embed in a single request. This is limited by the Minimax API to a maximum of 4096.

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.

minimaxApiKey?: string

Secret key to use when making requests. Defaults to the value of MINIMAX_API_KEY environment variable. Alias for apiKey

minimaxGroupId?: string

API key to use when making requests. Defaults to the value of MINIMAX_GROUP_ID environment variable.

model: string

Model name to use

modelName: string

Model name to use Alias for model

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.

stripNewLines?: boolean

Whether to strip new lines from the input text. This is recommended by Minimax, but may not be suitable for all use cases.

type?: "query" | "db"

The target use-case after generating the vector. When using embeddings, the vector of the target content is first generated through the db and stored in the vector database, and then the vector of the retrieval text is generated through the query. Note: For the parameters of the partial algorithm, we adopted a separate algorithm plan for query and db. Therefore, for a paragraph of text, if it is to be used as a retrieval text, it should use the db, and if it is used as a retrieval text, it should use the query.