# get_role

> **Function** in `langchain_cohere`

📖 [View in docs](https://reference.langchain.com/python/langchain-cohere/chat_models/get_role)

Get the role of the message.

## Signature

```python
get_role(
    message: BaseMessage,
) -> str
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `message` | `BaseMessage` | Yes | The message. |

## Returns

`str`

The role of the message.

---

[View source on GitHub](https://github.com/langchain-ai/langchain-cohere/blob/24cfdaefd4e3c785f477ccfe491a4226a0dbe88c/libs/cohere/langchain_cohere/chat_models.py#L164)