Skip to main content

Minimax

MinimaxEmbeddings 类使用 Minimax API 为给定文本生成嵌入向量。

¥The MinimaxEmbeddings class uses the Minimax API to generate embeddings for a given text.

设置

¥Setup

要使用 Minimax 模型,你需要一个 Minimax 账户、一个 API 密钥和一个组 ID。

¥To use Minimax model, you'll need a Minimax account, an API key, and a Group ID.

用法

¥Usage

import { MinimaxEmbeddings } from "langchain/embeddings/minimax";



export const run = async () => {
/* Embed queries */
const embeddings = new MinimaxEmbeddings();
const res = await embeddings.embedQuery("Hello world");
console.log(res);
/* Embed documents */
const documentRes = await embeddings.embedDocuments([
"Hello world",
"Bye bye",
]);
console.log({ documentRes });
};