Prime Minister Narendra Modi and Spanish President Pedro Sanchez hailed artificial intelligence as a transformative force.