The stock market spent much of the past two years celebrating artificial intelligence as the next great productivity boom.