Alphabet's Google agreed to pour up to $2 billion in investments in the artificial intelligence (AI) company Anthropic.