Interface Verifier

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Verifier
Quality gate that verifies whether a result meets acceptance criteria. Used by RecursiveTaskSolver to validate solutions.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    Verification result containing acceptance status and optional feedback.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Verifier
    A verifier that always accepts.
    static Verifier
    llmBased(com.tnsai.agents.Agent agent)
    Creates an LLM-based verifier that asks an agent to judge result quality.
    verify(String task, String result, int attemptNumber)
    Verifies if a result meets quality criteria.
  • Method Details

    • verify

      Verifier.Result verify(String task, String result, int attemptNumber)
      Verifies if a result meets quality criteria.
      Parameters:
      task - the original task
      result - the result to verify
      attemptNumber - which attempt this is (1-based)
      Returns:
      verification result
    • llmBased

      static Verifier llmBased(com.tnsai.agents.Agent agent)
      Creates an LLM-based verifier that asks an agent to judge result quality.
      Parameters:
      agent - the agent to use for verification
      Returns:
      an LLM-based verifier
    • alwaysAccept

      static Verifier alwaysAccept()
      A verifier that always accepts.