Package atessera.sensei.util
Class LlmService
java.lang.Object
atessera.sensei.util.LlmService
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks whether at least one LLM is configured and available.dev.langchain4j.model.openai.OpenAiChatModelCreates a chat model for technical tasks: directory selection, scoring, run command detection.dev.langchain4j.model.openai.OpenAiChatModelCreates a chat model for composing review responses (the sensei persona).
-
Constructor Details
-
LlmService
-
-
Method Details
-
isAvailable
public boolean isAvailable()Checks whether at least one LLM is configured and available.- Returns:
truewhen 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
writerLlmfrom the config. Falls back totechLlmwhenwriterLlmis 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
techLlmfrom the config. Falls back towriterLlmwhentechLlmis not configured.- Returns:
- a configured
OpenAiChatModel - Throws:
IllegalStateException- when neither tech nor writer LLM is configured
-