From Pixels to Poetry: The Evolution of Generative Artificial Intelligence