-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Iris: Enhance student support with proactive assistance (#9558)
- Loading branch information
Showing
53 changed files
with
1,581 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/main/java/de/tum/cit/aet/artemis/iris/domain/settings/event/IrisEventType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package de.tum.cit.aet.artemis.iris.domain.settings.event; | ||
|
||
/** | ||
* The type of event that can be triggered by the Iris system. | ||
*/ | ||
public enum IrisEventType { | ||
|
||
BUILD_FAILED, PROGRESS_STALLED, JOL | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/main/java/de/tum/cit/aet/artemis/iris/service/pyris/PyrisEventProcessingException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package de.tum.cit.aet.artemis.iris.service.pyris; | ||
|
||
/** | ||
* Exception thrown when an error occurs during Pyris event processing. | ||
*/ | ||
public class PyrisEventProcessingException extends RuntimeException { | ||
|
||
public PyrisEventProcessingException(String message) { | ||
super(message); | ||
} | ||
} |
66 changes: 66 additions & 0 deletions
66
src/main/java/de/tum/cit/aet/artemis/iris/service/pyris/PyrisEventService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package de.tum.cit.aet.artemis.iris.service.pyris; | ||
|
||
import static de.tum.cit.aet.artemis.core.config.Constants.PROFILE_IRIS; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.context.annotation.Profile; | ||
import org.springframework.stereotype.Service; | ||
|
||
import de.tum.cit.aet.artemis.iris.domain.session.IrisChatSession; | ||
import de.tum.cit.aet.artemis.iris.service.pyris.event.CompetencyJolSetEvent; | ||
import de.tum.cit.aet.artemis.iris.service.pyris.event.NewResultEvent; | ||
import de.tum.cit.aet.artemis.iris.service.pyris.event.PyrisEvent; | ||
import de.tum.cit.aet.artemis.iris.service.session.AbstractIrisChatSessionService; | ||
import de.tum.cit.aet.artemis.iris.service.session.IrisCourseChatSessionService; | ||
import de.tum.cit.aet.artemis.iris.service.session.IrisExerciseChatSessionService; | ||
|
||
/** | ||
* Service to handle Pyris events. | ||
*/ | ||
@Service | ||
@Profile(PROFILE_IRIS) | ||
public class PyrisEventService { | ||
|
||
private static final Logger log = LoggerFactory.getLogger(PyrisEventService.class); | ||
|
||
private final IrisCourseChatSessionService irisCourseChatSessionService; | ||
|
||
private final IrisExerciseChatSessionService irisExerciseChatSessionService; | ||
|
||
public PyrisEventService(IrisCourseChatSessionService irisCourseChatSessionService, IrisExerciseChatSessionService irisExerciseChatSessionService) { | ||
this.irisCourseChatSessionService = irisCourseChatSessionService; | ||
this.irisExerciseChatSessionService = irisExerciseChatSessionService; | ||
} | ||
|
||
/** | ||
* Triggers a Pyris pipeline based on the received {@link PyrisEvent}. | ||
* | ||
* @param event The event object received to trigger the matching pipeline | ||
* @throws UnsupportedPyrisEventException if the event is not supported | ||
* | ||
* @see PyrisEvent | ||
*/ | ||
public void trigger(PyrisEvent<? extends AbstractIrisChatSessionService<? extends IrisChatSession>, ?> event) { | ||
log.debug("Starting to process event of type: {}", event.getClass().getSimpleName()); | ||
try { | ||
switch (event) { | ||
case CompetencyJolSetEvent competencyJolSetEvent -> { | ||
log.info("Processing CompetencyJolSetEvent: {}", competencyJolSetEvent); | ||
competencyJolSetEvent.handleEvent(irisCourseChatSessionService); | ||
log.debug("Successfully processed CompetencyJolSetEvent"); | ||
} | ||
case NewResultEvent newResultEvent -> { | ||
log.info("Processing NewResultEvent: {}", newResultEvent); | ||
newResultEvent.handleEvent(irisExerciseChatSessionService); | ||
log.debug("Successfully processed NewResultEvent"); | ||
} | ||
default -> throw new UnsupportedPyrisEventException("Unsupported event type: " + event.getClass().getSimpleName()); | ||
} | ||
} | ||
catch (Exception e) { | ||
log.error("Failed to process event: {}", event, e); | ||
throw e; | ||
} | ||
} | ||
} |
Oops, something went wrong.