def to_watsonx_message_dict(message: ChatMessage) -> dict:
    """Convert generic message to message dict."""
    message_dict = {
        "role": message.role.value,
        "content": message.content,
    }

    message_dict.update(message.additional_kwargs)

    return message_dict
Convert generic message to message dict.
llama-index-integrations/llms/llama-index-llms-ibm/llama_index/llms/ibm/utils.py