Cohere
caution
You are currently on a page documenting the use of Cohere models as text completion models. Many popular Cohere models are chat completion models.
You may be looking for this page instead.
Cohere is a Canadian startup that provides natural language processing models that help companies improve human-machine interactions.
Head to the API reference for detailed documentation of all attributes and methods.
Overview
Integration details
Class | Package | Local | Serializable | JS support | Package downloads | Package latest |
---|---|---|---|---|---|---|
Cohere | langchain_community | ❌ | beta | ✅ |
Setup
The integration lives in the langchain-community
package. We also need to install the cohere
package itself. We can install these with:
Credentials
We'll need to get a Cohere API key and set the COHERE_API_KEY
environment variable:
import getpass
import os
if "COHERE_API_KEY" not in os.environ:
os.environ["COHERE_API_KEY"] = getpass.getpass()