nemoguardrails.embeddings.providers.cohere
Module Contents
Classes
Data
API
Bases: EmbeddingModel
Embedding model using Cohere API.
To use, you must have either:
- The
COHERE_API_KEYenvironment variable set with your API key, or - Pass your API key using the api_key kwarg to the Cohere constructor.
Parameters:
embedding_model
The name of the embedding model.
input_type
The type of input for the embedding model, default is “search_document”. “search_document”, “search_query”, “classification”, “clustering”, “image”
client
embedding_size
embedding_size_dict
engine_name
Encode a list of documents into embeddings.
Parameters:
documents
The list of documents to be encoded.
Returns: List[List[float]]
List[List[float]]: The encoded embeddings.
async
Encode a list of documents into embeddings.
Parameters:
documents
The list of documents to be encoded.
Returns: List[List[float]]
List[List[float]]: The encoded embeddings.