A Fife school is leading the way in teaching pupils about AI in an effort to prevent a digital divide.