Microsoft says it is making a multiyear, multibillion dollar investment in the artificial intelligence startup openai, maker of chatgpt and other tools that can generate readable text, images and computer code.