def from_openai_messages(
    openai_messages: Sequence[ChatCompletionMessage], modalities: List[str]
) -> List[ChatMessage]:
    """Convert openai message dicts to generic messages."""
    return [from_openai_message(message, modalities) for message in openai_messages]
Convert openai message dicts to generic messages.
llama-index-integrations/llms/llama-index-llms-openai/llama_index/llms/openai/utils.py