Pope Francis warned world leaders in Italy about the potential dangers of artificial intelligence as well as the war in Ukraine.