Files
langchain/docs/extras/modules/data_connection/text_embedding/integrations/cohere.ipynb
T
87e502c6bc Doc refactor (#6300)
Co-authored-by: jacoblee93 <jacoblee93@gmail.com>
Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
2023-06-16 11:52:56 -07:00

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 [ ]: