The deal, which includes a broad partnership, follows Microsoft’s multibillion-dollar stake in rival startup OpenAI.