LangChain
Cohere has first class support for LangChain, a framework which enables you to quickly create LLM powered applications. This doc will guide you through how to leverage different Cohere features with LangChain.
Prerequisite
To use LangChain and Cohere you will need:
-
LangChain package. To install it, run
pip install langchain
. -
LangChain Package. To install it, run:
pip install langchain
pip install langchain-cohere
(to use the Cohere integrations in LangChain)- Optional:
pip install langchain-community
(to access third-party integrations such as web search APIs)
-
Cohere’s SDK. To install it, run
pip install cohere
. If you run into any issues or want more details on Cohere’s SDK, see this wiki. -
A Cohere API Key. For more details on pricing see this page. When you create an account with Cohere, we automatically create a trial API key for you. This key will be available on the dashboard where you can copy it, and it’s in the dashboard section called “API Keys” as well.
Integrating LangChain with Cohere Models
The following guides contain technical details on the many ways in which Cohere and LangChain can be used in tandem: