Class SenseiConfig

java.lang.Object
atessera.sensei.SenseiConfig

public final class SenseiConfig extends Object
Global configuration of the laboratory checking system.

The configuration can be supplied as a JSON file through load(Path). Values that are not present in the JSON keep their field initializers, so a configuration file may specify only the parts it needs to override.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Parameters for a single LLM endpoint.
    static final class 
    SMTP related settings.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    List of laboratory works which can be assigned to students
    SMTP settings used for sending result e-mails.
    LLM parameters used for technical tasks: directory selection, scoring, run command detection.
    LLM parameters used for composing review responses to students (the sensei persona).
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks whether at least one LLM is configured and available.
    boolean
    Checks whether SMTP settings look sufficient for sending mail.
    boolean
    Checks whether the tech LLM is configured and has an API key.
    boolean
    Checks whether the writer LLM is configured and has an API key.
    load(Path path)
    Loads the configuration from a JSON file.
    void
    save(Path path)
    Writes the configuration to a JSON file.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • writerLlm

      public SenseiConfig.LlmParams writerLlm
      LLM parameters used for composing review responses to students (the sensei persona).
    • techLlm

      public SenseiConfig.LlmParams techLlm
      LLM parameters used for technical tasks: directory selection, scoring, run command detection.
    • smtp

      public SenseiConfig.Smtp smtp
      SMTP settings used for sending result e-mails.
    • labWorks

      public List<LabWork> labWorks
      List of laboratory works which can be assigned to students
  • Constructor Details

    • SenseiConfig

      public SenseiConfig()
  • Method Details

    • load

      public static SenseiConfig load(Path path) throws IOException
      Loads the configuration from a JSON file.
      Parameters:
      path - path to the JSON configuration file; must not be null
      Returns:
      the loaded configuration
      Throws:
      IOException - if the file cannot be read
    • save

      public void save(Path path) throws IOException
      Writes the configuration to a JSON file.

      Parent directories are created when necessary.

      Parameters:
      path - target file path; must not be null
      Throws:
      IOException - when the file cannot be written
    • hasWriterLlm

      public boolean hasWriterLlm()
      Checks whether the writer LLM is configured and has an API key.
      Returns:
      true when writer LLM can be used
    • hasTechLlm

      public boolean hasTechLlm()
      Checks whether the tech LLM is configured and has an API key.
      Returns:
      true when tech LLM can be used
    • hasAnyLlm

      public boolean hasAnyLlm()
      Checks whether at least one LLM is configured and available.
      Returns:
      true when any LLM-based checks can be performed
    • hasSmtp

      public boolean hasSmtp()
      Checks whether SMTP settings look sufficient for sending mail.
      Returns:
      true when SMTP host and sender are configured