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

# semantic_router.llms.cohere

## CohereLLM Objects

```python theme={null}
class CohereLLM(BaseLLM)
```

LLM for Cohere. Requires a Cohere API key from [https://dashboard.cohere.com/api-keys](https://dashboard.cohere.com/api-keys).

This class provides functionality to interact with the Cohere API for generating text responses.
It extends the BaseLLM class and implements the **call** method to generate text responses.

#### \_\_init\_\_

```python theme={null}
def __init__(name: Optional[str] = None, cohere_api_key: Optional[str] = None)
```

Initialize the CohereLLM.

**Arguments**:

* `name` (`Optional[str]`): The name of the Cohere model to use can also be set via the
  COHERE\_CHAT\_MODEL\_NAME environment variable.
* `cohere_api_key` (`Optional[str]`): The API key for the Cohere client. Can also be set via the
  COHERE\_API\_KEY environment variable.

#### \_\_call\_\_

```python theme={null}
def __call__(messages: List[Message]) -> str
```

Call the Cohere client.

**Arguments**:

* `messages` (`List[Message]`): The messages to pass to the Cohere client.

**Returns**:

`str`: The response from the Cohere client.
