Files
langchain/docs/extras/integrations/text_embedding/cohere.ipynb
T

1.8 KiB

Cohere

Let's load the Cohere Embedding class.

In [1]:
from langchain.embeddings import CohereEmbeddings
In [2]:
embeddings = CohereEmbeddings(cohere_api_key=cohere_api_key)
In [3]:
text = "This is a test document."
In [4]:
query_result = embeddings.embed_query(text)
In [5]:
doc_result = embeddings.embed_documents([text])
In [ ]: