def _generate_message(content: str, images: list[str] | None) -> dict:
        """Generate a message for the ChatGPT API.

        Args:
            content (str): Text content of the message
            images (list[str] | None): List of base64-encoded image URLs

        Returns:
            dict: Formatted message dictionary for the API
        """
        message: dict[str, list[dict] | str] = {"role": "user"}
        if images is not None:
            _content: list[dict[str, str | dict]] = [{"type": "text", "text": content}]
            _content.extend([{"type": "image_url", "image_url": {"url": image}} for image in images])
            message["content"] = _content
        else:
            message["content"] = content
        return message
Generate a message for the ChatGPT API.

        Args:
            content (str): Text content of the message
            images (list[str] | None): List of base64-encoded image URLs

        Returns:
            dict: Formatted message dictionary for the API
        
src/anomalib/models/image/vlm_ad/backends/chat_gpt.py