def _from_message_dict(message_dict: Dict[str, Any]) -> ChatMessage:
    """
    Convert a message dictionary to a ChatMessage object.

    Args:
        message_dict: The message dictionary.

    Returns:
        A ChatMessage object representing the given dictionary.

    """
    return ChatMessage(
        role=message_dict.get("role"),
        content=message_dict.get("content"),
        additional_kwargs={"tool_calls": message_dict.get("tool_calls", [])},
    )

    Convert a message dictionary to a ChatMessage object.

    Args:
        message_dict: The message dictionary.

    Returns:
        A ChatMessage object representing the given dictionary.

    
llama-index-integrations/llms/llama-index-llms-oci-data-science/llama_index/llms/oci_data_science/utils.py