def _get_curr_chat_turn_messages(messages: List[ChatMessage]) -> List[ChatMessage]:
    """Get the messages for the current chat turn."""
    current_chat_turn_messages = []
    for message in messages[::-1]:
        current_chat_turn_messages.append(message)
        if message.role == MessageRole.USER:
            break
    return current_chat_turn_messages[::-1]
Get the messages for the current chat turn.
llama-index-integrations/llms/llama-index-llms-cohere/llama_index/llms/cohere/utils.py