Class LlmPresenceValidator

java.lang.Object
com.tnsai.agents.validation.validators.LlmPresenceValidator
All Implemented Interfaces:
Validator

public final class LlmPresenceValidator extends Object implements Validator
AGENT-V002 — LLM should normally be present.

Emits a Severity.WARNING (not an error) when AgentBuilder.llm(...) was not called: agents can legitimately operate with LOCAL / WEB_SERVICE actions only, but in practice this is rare and the symptom of a forgotten .llm(...) call is a runtime "No LLM configured in fallback chain" on first chat — many minutes after build. The warning surfaces it at build-time so the user can decide whether the omission is intentional.

Since:
0.5.0 (issue #85)
  • Constructor Details

    • LlmPresenceValidator

      public LlmPresenceValidator()
  • Method Details

    • id

      public String id()
      Description copied from interface: Validator
      Short, stable id for logging and test assertions (e.g. "llm-presence").
      Specified by:
      id in interface Validator
    • validate

      public List<ValidationIssue> validate(ValidationContext ctx)
      Description copied from interface: Validator
      Inspect the agent configuration and return any issues detected. Returning an empty list means "no problems found by this validator".
      Specified by:
      validate in interface Validator
      Parameters:
      ctx - frozen view of the agent under construction
      Returns:
      zero-or-more issues; never null