langchain_community.chat_models.cohere.get_role¶

langchain_community.chat_models.cohere.get_role(message: BaseMessage) str[source]¶

Get the role of the message.

Parameters

message – The message.

Returns

The role of the message.

Raises

ValueError – If the message is of an unknown type.