Skip to main content

Cohere

The CohereEmbeddings class uses the Cohere API to generate embeddings for a given text.

npm install cohere-ai
import { CohereEmbeddings } from "langchain/embeddings/cohere";

const embeddings = new CohereEmbeddings({
apiKey: "YOUR-API-KEY", // In Node.js defaults to process.env.COHERE_API_KEY
batchSize: 48, // Default value if omitted is 48. Max value is 96
});