Cohere and LangChain (Integration Guide)
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: