A class for generating embeddings using the Cohere API.

Example

// Embed a query using the CohereEmbeddings class
const model = new ChatOpenAI();
const res = await model.embedQuery(
"What would be a good company name for a company that makes colorful socks?",
);
console.log({ res });

Hierarchy

Implements

Constructors

Properties

batchSize: number = 48

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

caller: AsyncCaller

The async caller should be used by subclasses to make any async calls, which will thus benefit from the concurrency and retry logic.

modelName: string = "small"

Methods

Generated using TypeDoc