docs: Update cohere.mdx, Text embedding had incorrect code snippet (#15840)

text embedding code snippet was incorrect.
pull/15242/head^2
Daniel 6 months ago committed by GitHub
parent e6240fecab
commit 6d299a55c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -58,10 +58,8 @@ print(rag.get_relevant_documents("What is cohere ai?"))
### Text Embedding
```python
from langchain_community.chat_models import ChatCohere
from langchain.retrievers import CohereRagRetriever
from langchain_core.documents import Document
from langchain_community.embeddings import CohereEmbeddings
rag = CohereRagRetriever(llm=ChatCohere())
print(rag.get_relevant_documents("What is cohere ai?"))
embeddings = CohereEmbeddings(model="embed-english-light-v3.0")
print(embeddings.embed_documents(["This is a test document."]))
```

Loading…
Cancel
Save