Constructor for the CohereEmbeddings class.
Optional
fields: Partial<CohereEmbeddingsParams> & { apiKey?: string; verbose?: boolean }An optional object with properties to configure the instance.
The maximum number of documents to embed in a single request. This is limited by the Cohere API to a maximum of 96.
Generates embeddings for an array of texts.
An array of strings to generate embeddings for.
A Promise that resolves to an array of embeddings.
Generates an embedding for a single text.
A string to generate an embedding for.
A Promise that resolves to an array of numbers representing the embedding.
A class for generating embeddings using the Cohere API.
Example
Deprecated
Use
CohereEmbeddings
from@langchain/cohere
instead.