def _convert_message_to_dict(message: ChatMessage) -> Dict[str, Any]:
    """
    Converts a ChatMessage to a dictionary with Role / content.

    Args:
        message: ChatMessage
    Returns:
        messages_dict:  role / content dict

    """
    if isinstance(message, ChatMessage):
        message_dict = {"role": message.role, "content": message.content}
    else:
        raise TypeError(f"Got unknown type {message}")
    return message_dict

    Converts a ChatMessage to a dictionary with Role / content.

    Args:
        message: ChatMessage
    Returns:
        messages_dict:  role / content dict

    
llama-index-integrations/llms/llama-index-llms-sambanovasystems/llama_index/llms/sambanovasystems/base.py