Optional
fields: Partial<MinimaxEmbeddingsParams> & { Optional
apiSecret key to use when making requests. Defaults to the value of
MINIMAX_API_KEY
environment variable.
Optional
baseThe maximum number of documents to embed in a single request. This is limited by the Minimax API to a maximum of 4096.
The async caller should be used by subclasses to make any async calls, which will thus benefit from the concurrency and retry logic.
Optional
headersOptional
minimaxSecret key to use when making requests. Defaults to the value of
MINIMAX_API_KEY
environment variable.
Alias for apiKey
Optional
minimaxAPI key to use when making requests. Defaults to the value of
MINIMAX_GROUP_ID
environment variable.
Model name to use
Model name to use
Alias for model
Whether to strip new lines from the input text. This is recommended by Minimax, but may not be suitable for all use cases.
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.
Method to generate embeddings for an array of documents. Splits the documents into batches and makes requests to the Minimax API to generate embeddings.
Array of documents to generate embeddings for.
Promise that resolves to a 2D array of embeddings for each document.
Class for generating embeddings using the Minimax API. Extends the Embeddings class and implements MinimaxEmbeddingsParams
Example