def test_drop_none(self):
        """Ensures drop_none parameter works correctly for sequences."""
        messages = [
            ChatMessage(role=MessageRole.USER, content=None),
            ChatMessage(
                role=MessageRole.ASSISTANT,
                content="Hi there!",
                additional_kwargs={"custom_field": None},
            ),
        ]
        expected_result = [
            {"role": "user"},
            {"role": "assistant", "content": "Hi there!"},
        ]
        result = _to_message_dicts(messages, drop_none=True)
        assert result == expected_result
Ensures drop_none parameter works correctly for sequences.
llama-index-integrations/llms/llama-index-llms-oci-data-science/tests/test_oci_data_science_utils.py