Langchain-Cohere
This package contains the LangChain integrations for Cohere.
Cohere empowers every developer and enterprise to build amazing products and capture true business value with language AI.
Installation
Install the langchain-cohere package:
pip install langchain-cohere
Get a Cohere API key and set it as an environment variable (COHERE_API_KEY)
Migration from langchain-community
Cohere's integrations used to be part of the langchain-community package, but since version 0.0.30 the integration in langchain-community has been deprecated in favour langchain-cohere.
The two steps to migrate are:
Import from langchain_cohere instead of langchain_community, for example:
from langchain_community.chat_models import ChatCohere -> from langchain_cohere import ChatCohere
from langchain_community.retrievers import CohereRagRetriever -> from langchain_cohere import CohereRagRetriever
from langchain.embeddings import CohereEmbeddings -> from langchain_cohere import CohereEmbeddings
|