The software giant is confronting the AI tide by shaking itself up before someone else does.