It all depends on the guidelines provided by the teacher. If such guidelines have not been given, you should ask the teacher directly about it. If the use of GenAI is allowed in real time during classes, then – although it can be helpful – it is very important that it does not distract you from the lecture or classes.