After two years of negotiations, the European Union agreed on a regulatory framework for artificial intelligence.