CohereEmbeddings class, which is a wrapper around the Cohere API.
Installation
Embeddings require thecohere library. See the Installation Guide for more information.
Embed text using Cohere embeddings
CohereEmbeddings class, which is a wrapper around the Cohere API.
cohere library. See the Installation Guide for more information.
from chonkie import CohereEmbeddings
# Initialize Cohere embeddings
embeddings = CohereEmbeddings()
# Specify model and API key
embeddings = CohereEmbeddings(model="embed-english-light-v3.0", api_key="YOUR_API_KEY")
embeddings = CohereEmbeddings()
vectors = embeddings.embed("your text here")
# Or you can
vectors = embeddings.embed_batch(["text1", "text2"])
Was this page helpful?