The Evolution of AI: From Rule-Based Systems to Generative Models