> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alumio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cohere

> Connect Alumio to Cohere.

## Extra information

System documentation: [Cohere API Reference](https://docs.cohere.com/v2/reference/about)

### Setting up HTTP Client Cohere

**Steps**

1. In Alumio Dashboard, go to Connections → HTTPS (API). Create a new HTTP Client and select Cohere HTTP Client as the prototype of the HTTP Client.

2. Fill in the Base URI and Token.

### Subscribing to Entities from Cohere

**Steps**

1. Go to Integrations → Incoming and create a new Incoming configuration and select Cohere Subscriber as the subscriber.

2. Select the entity you want to subscribe to from Cohere.

3. Add any request parameters needed to subscribe to the entity (optional).

4. You can optionally add a transformer to transform the request parameters into something you need.

5. Select the Cohere HTTP Client to use.

**General Concept**
We follow the Cohere documentation on building this connector so you can easily use the connector based on the Cohere API Reference.

**Entity**
It’s the entity you want to subscribe to from Cohere. Please refer to the entities in the Management APIs from the Cohere API Reference page.

**Request Parameters**
These are the parameters you can provide to get the needed entity based on the Cohere API Reference. Please look at the example below on how to fill the Request Parameters field when subscribing Single Request entity.

<img src="https://mintcdn.com/alumio/rvdAjy4YRzDDREsn/images/connectors/cohere-01.png?fit=max&auto=format&n=rvdAjy4YRzDDREsn&q=85&s=2543ad21fa7b345acf89c0550afc1840" alt="Cohere connector screenshot 1" width="690" height="471" data-path="images/connectors/cohere-01.png" />

* Path is the path parameter of the URL. For example, the \{id}.
* Query is a defined set of parameters attached to the end of a URL.\
  Example: [www.url.com?type=true\&start=0](http://www.url.com?type=true\&start=0)

<img src="https://mintcdn.com/alumio/rvdAjy4YRzDDREsn/images/connectors/cohere-02.png?fit=max&auto=format&n=rvdAjy4YRzDDREsn&q=85&s=0fbe217aa545a3abf4cff21181f9a4db" alt="Cohere connector screenshot 2" width="433" height="143" data-path="images/connectors/cohere-02.png" />

That’s why we need to define **id** property inside **path** property in the Request Parameters field. The properties inside **query** parameters will be parsed as query parameters. Here is the final URL that will be called when using such Request Parameters field on the dataset entity.

`/v1/datasets/123456`

**Input Transformer**

Any transformer set here will be executed after the Request Parameters are loaded. So, you basically can add any transformer to provide and transform the request parameters into anything you need, either as path parameters and/or as query parameters of an entity.

**HTTP Client**
It’s the HTTP Client configuration or prototype you will use to access Cohere.

### Publishing Entity to Cohere

**Steps**

1. Go to Integrations → Outgoing, create a new Outgoing configuration, and select CoherePublisher as the publisher.
2. Select the method that you want the publisher to use with the data.
3. Select the Cohere entity you want the data to be published to.
4. Select the HTTP Client to use.
   <img src="https://mintcdn.com/alumio/rvdAjy4YRzDDREsn/images/connectors/cohere-03.png?fit=max&auto=format&n=rvdAjy4YRzDDREsn&q=85&s=33b3fca288bdee14279e19e6c66e1952" alt="Cohere connector screenshot 3" width="690" height="288" data-path="images/connectors/cohere-03.png" />

**General Concept**

Like the subscriber, the publisher has similar methods on how to use it. The difference is the payload that will be submitted by the publisher originating from the data (from routes, from transformers in the Outgoing configuration).

**Method**
Currently, we support Post (HTTP POST method), Patch (HTTP PATCH method), and Delete (HTTP DELETE method).

**Entity**
We support publishing to most Cohere endpoints but not with publishing binary files at the moment. Please refer to the entities in the Management APIs from the Cohere API Reference page. Based on the documentation, some endpoints may need one or more path parameters.

For endpoints that require an object as the request payload, please look at the example below. For example, we want to Chat with Streaming Outputs. Please select “Post” as the action and “Chat / Chat with Streaming Outputs (API V2)” as the entity of the publisher.

<img src="https://mintcdn.com/alumio/rvdAjy4YRzDDREsn/images/connectors/cohere-04.png?fit=max&auto=format&n=rvdAjy4YRzDDREsn&q=85&s=b4ed37ed3302d7ca72af2a84cd8c0eb7" alt="Cohere connector screenshot 4" width="690" height="288" data-path="images/connectors/cohere-04.png" />

<img src="https://mintcdn.com/alumio/rvdAjy4YRzDDREsn/images/connectors/cohere-05.png?fit=max&auto=format&n=rvdAjy4YRzDDREsn&q=85&s=23afe683c35f776cd7d0b181d9bc2d8b" alt="Cohere connector screenshot 5" width="455" height="141" data-path="images/connectors/cohere-05.png" />

You can put the payload you want to send to Cohere into the payload property in the data (go to Advanced).

* Path is the path parameter of the URL. For example, the \{id}.
* Query is a defined set of parameters attached to the end of a URL.\
  Example: [www.url.com?type=true\&start=0](http://www.url.com?type=true\&start=0)
* Payload is the data contained within a request.

Alumio will send an API request to Cohere with URL `/v2/chat`

**HTTP Client**

It’s the HTTP Client configuration or prototype you will use to access Cohere.
