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 | Downloads | Version |
---|---|---|---|---|---|---|
Cohere | langchain-community | ❌ | beta | ✅ |
Setup
The integration lives in thelangchain-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 theCOHERE_API_KEY
environment variable:
Installation
Invocation
Cohere supports all LLM functionality:Chaining
You can also easily combine with a prompt template for easy structuring of user input. We can do this using LCELAPI reference
For detailed documentation of allCohere
llm features and configurations head to the API reference: python.langchain.com/api_reference/community/llms/langchain_community.llms.cohere.Cohere.html