def _tokenizer_messages_to_prompt(self, messages: Sequence[ChatMessage]) -> str:
        """Use the tokenizer to convert messages to prompt. Fallback to generic."""
        if hasattr(self._tokenizer, "apply_chat_template"):
            messages_dict = [
                {"role": message.role.value, "content": message.content}
                for message in messages
            ]
            return (
                self._tokenizer.apply_chat_template(
                    messages_dict, add_generation_prompt=True
                )
                if isinstance(self._tokenizer, openvino_genai.Tokenizer)
                else self._tokenizer.apply_chat_template(
                    messages_dict, tokenize=False, add_generation_prompt=True
                )
            )

        return generic_messages_to_prompt(messages)
Use the tokenizer to convert messages to prompt. Fallback to generic.
llama-index-integrations/llms/llama-index-llms-openvino-genai/llama_index/llms/openvino_genai/base.py