Cohere
In this section, we present how to bring Cohere models to MindsDB.
Cohere offers world-class generative models and industry-best retrieval capabilities, which is the key combination to unlocking Generative AI value for the enterprise.
Read on to find out how to use Cohere models within MinsdDB.
Setup
MindsDB provides the Cohere handler that enables you to create Cohere models within MindsDB.
AI Engine
Before creating a model, it is required to create an AI engine based on the provided handler.
If you installed MindsDB locally, make sure to install all Cohere dependencies by running pip install .[cohere]
or from the requirements.txt file.
You can create an Cohere engine using this command:
Please note that you need to provide your Cohere API key. Once you sign up for a Cohere account, an API key can be requested from the Cohere dashboard. Learn more here.
The name of the engine (here, cohere_engine
) should be used as a value for the engine
parameter in the USING
clause of the CREATE MODEL
statement.
AI Model
The CREATE MODEL
statement is used to create, train, and deploy models within MindsDB.
Where:
Name | Description |
---|---|
task | It defines the task to be accomplished. |
column | It defines the column with the text to be acted upon. |
engine | It defines the Cohere engine. |
api_key | It is used to provide your Cohere API key to gain access to the model. |
Usage
Once you have created an Cohere model, you can use it to make predictions.
On execution, we get:
Supported Tasks
The following tasks are supported by the Cohere handler:
language-detection
: detect the language of a given text.text-generation
: generate text based on a given prompt.text-summarization
: summarize a given text.
For more information about the Cohere handler, visit the repository here.