class MinimaxEmbeddingsClass for generating embeddings using the Minimax API. Extends the Embeddings class and implements MinimaxEmbeddingsParams
Prompt processing batch size.
The async caller should be used by subclasses to make any async calls, which will thus benefit from the concurrency and retry logic.
Secret key to use when making requests. Defaults to the value of
MINIMAX_API_KEY environment variable.
Alias for apiKey
API key to use when making requests. Defaults to the value of
MINIMAX_GROUP_ID environment variable.
Model name to use. Available options are: qwen-turbo, qwen-plus, qwen-max, or Other compatible models.
Model name to use. Available options are: qwen-turbo, qwen-plus, qwen-max, or Other compatible models.
Alias for model
Whether to strip new lines from the input text.
Method to generate embeddings for an array of documents. Splits the documents into batches and makes requests to the AlibabaTongyi API to generate embeddings.
Method to generate an embedding for a single document. Calls the embeddingWithRetry method with the document as the input.
const embeddings = new MinimaxEmbeddings();
// Embed a single query
const queryEmbedding = await embeddings.embedQuery("Hello world");
console.log(queryEmbedding);
// Embed multiple documents
const documentsEmbedding = await embeddings.embedDocuments([
"Hello world",
"Bye bye",
]);
console.log(documentsEmbedding);