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.

  • Field Details

    • openAiApiKey

      public String openAiApiKey
      API key used to access the OpenAI compatible endpoint.
    • openAiBaseUrl

      public String openAiBaseUrl
      Base URL of the OpenAI compatible API.
    • openAiModel

      public String openAiModel
      Chat model name used for code review and verdict summarization.
    • mvStorePath

      public String mvStorePath
      Path to the MVStore database file.
    • smtp

      public SenseiConfig.Smtp smtp
      SMTP settings used for sending result e-mails.
  • 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
    • createSample

      public static SenseiConfig createSample()
      Creates a configuration with sample values for every field.

      The OpenAI API key is taken from the OPENAI_API_KEY environment variable when present, otherwise a placeholder is used.

      Returns:
      a configuration filled with sample values
    • 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
    • hasOpenAiKey

      public boolean hasOpenAiKey()
      Checks whether an OpenAI API key is available.
      Returns:
      true when 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