def test_sequence_conversion(self):
        """Ensures a sequence of ChatMessages is converted correctly."""
        messages = [
            ChatMessage(role=MessageRole.USER, content="Hello"),
            ChatMessage(role=MessageRole.ASSISTANT, content="Hi there!"),
        ]
        expected_result = [
            {"role": "user", "content": "Hello"},
            {"role": "assistant", "content": "Hi there!"},
        ]
        result = _to_message_dicts(messages)
        assert result == expected_result
Ensures a sequence of ChatMessages is converted correctly.
llama-index-integrations/llms/llama-index-llms-oci-data-science/tests/test_oci_data_science_utils.py