Class LlmService

java.lang.Object
atessera.sensei.util.LlmService

public final class LlmService extends Object
Factory for creating LLM chat models from SenseiConfig.

Supports two distinct model configurations: writerLlm for composing review responses in the sensei persona, and techLlm for technical tasks such as directory selection, scoring, and run command detection. When one of them is not explicitly configured, it falls back to the other. If neither is configured, the service is considered unavailable.

  • Constructor Details

  • Method Details

    • isAvailable

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

      public dev.langchain4j.model.openai.OpenAiChatModel newWriterChatModel()
      Creates a chat model for composing review responses (the sensei persona).

      Uses writerLlm from the config. Falls back to techLlm when writerLlm is not configured.

      Returns:
      a configured OpenAiChatModel
      Throws:
      IllegalStateException - when neither writer nor tech LLM is configured
    • newTechChatModel

      public dev.langchain4j.model.openai.OpenAiChatModel newTechChatModel()
      Creates a chat model for technical tasks: directory selection, scoring, run command detection.

      Uses techLlm from the config. Falls back to writerLlm when techLlm is not configured.

      Returns:
      a configured OpenAiChatModel
      Throws:
      IllegalStateException - when neither tech nor writer LLM is configured